edgecenter.ProtectionResourceHeader
Explore with Pulumi AI
Represent additional HTTP header returned to user by DDoS protection resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as edgecenter from "@pulumi/edgecenter";
const protectedExampleCom = new edgecenter.ProtectionResource("protectedExampleCom", {tls: [
"1.2",
"1.3",
]});
const header1 = new edgecenter.ProtectionResourceHeader("header1", {
resource: protectedExampleCom.protectionResourceId,
key: "X-My-Header-1",
value: "Value 1",
});
const header2 = new edgecenter.ProtectionResourceHeader("header2", {
resource: protectedExampleCom.protectionResourceId,
key: "X-My-Header-2",
value: "Value 2",
});
import pulumi
import pulumi_edgecenter as edgecenter
protected_example_com = edgecenter.ProtectionResource("protectedExampleCom", tls=[
"1.2",
"1.3",
])
header1 = edgecenter.ProtectionResourceHeader("header1",
resource=protected_example_com.protection_resource_id,
key="X-My-Header-1",
value="Value 1")
header2 = edgecenter.ProtectionResourceHeader("header2",
resource=protected_example_com.protection_resource_id,
key="X-My-Header-2",
value="Value 2")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/edgecenter/edgecenter"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
protectedExampleCom, err := edgecenter.NewProtectionResource(ctx, "protectedExampleCom", &edgecenter.ProtectionResourceArgs{
Tls: pulumi.StringArray{
pulumi.String("1.2"),
pulumi.String("1.3"),
},
})
if err != nil {
return err
}
_, err = edgecenter.NewProtectionResourceHeader(ctx, "header1", &edgecenter.ProtectionResourceHeaderArgs{
Resource: protectedExampleCom.ProtectionResourceId,
Key: pulumi.String("X-My-Header-1"),
Value: pulumi.String("Value 1"),
})
if err != nil {
return err
}
_, err = edgecenter.NewProtectionResourceHeader(ctx, "header2", &edgecenter.ProtectionResourceHeaderArgs{
Resource: protectedExampleCom.ProtectionResourceId,
Key: pulumi.String("X-My-Header-2"),
Value: pulumi.String("Value 2"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Edgecenter = Pulumi.Edgecenter;
return await Deployment.RunAsync(() =>
{
var protectedExampleCom = new Edgecenter.ProtectionResource("protectedExampleCom", new()
{
Tls = new[]
{
"1.2",
"1.3",
},
});
var header1 = new Edgecenter.ProtectionResourceHeader("header1", new()
{
Resource = protectedExampleCom.ProtectionResourceId,
Key = "X-My-Header-1",
Value = "Value 1",
});
var header2 = new Edgecenter.ProtectionResourceHeader("header2", new()
{
Resource = protectedExampleCom.ProtectionResourceId,
Key = "X-My-Header-2",
Value = "Value 2",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.edgecenter.ProtectionResource;
import com.pulumi.edgecenter.ProtectionResourceArgs;
import com.pulumi.edgecenter.ProtectionResourceHeader;
import com.pulumi.edgecenter.ProtectionResourceHeaderArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var protectedExampleCom = new ProtectionResource("protectedExampleCom", ProtectionResourceArgs.builder()
.tls(
"1.2",
"1.3")
.build());
var header1 = new ProtectionResourceHeader("header1", ProtectionResourceHeaderArgs.builder()
.resource(protectedExampleCom.protectionResourceId())
.key("X-My-Header-1")
.value("Value 1")
.build());
var header2 = new ProtectionResourceHeader("header2", ProtectionResourceHeaderArgs.builder()
.resource(protectedExampleCom.protectionResourceId())
.key("X-My-Header-2")
.value("Value 2")
.build());
}
}
resources:
protectedExampleCom:
type: edgecenter:ProtectionResource
properties:
tls:
- '1.2'
- '1.3'
header1:
type: edgecenter:ProtectionResourceHeader
properties:
resource: ${protectedExampleCom.protectionResourceId}
key: X-My-Header-1
value: Value 1
header2:
type: edgecenter:ProtectionResourceHeader
properties:
resource: ${protectedExampleCom.protectionResourceId}
key: X-My-Header-2
value: Value 2
Create ProtectionResourceHeader Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProtectionResourceHeader(name: string, args: ProtectionResourceHeaderArgs, opts?: CustomResourceOptions);
@overload
def ProtectionResourceHeader(resource_name: str,
args: ProtectionResourceHeaderArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProtectionResourceHeader(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
resource: Optional[str] = None,
value: Optional[str] = None,
protection_resource_header_id: Optional[str] = None)
func NewProtectionResourceHeader(ctx *Context, name string, args ProtectionResourceHeaderArgs, opts ...ResourceOption) (*ProtectionResourceHeader, error)
public ProtectionResourceHeader(string name, ProtectionResourceHeaderArgs args, CustomResourceOptions? opts = null)
public ProtectionResourceHeader(String name, ProtectionResourceHeaderArgs args)
public ProtectionResourceHeader(String name, ProtectionResourceHeaderArgs args, CustomResourceOptions options)
type: edgecenter:ProtectionResourceHeader
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ProtectionResourceHeaderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProtectionResourceHeaderArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProtectionResourceHeaderArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProtectionResourceHeaderArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProtectionResourceHeaderArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var protectionResourceHeaderResource = new Edgecenter.ProtectionResourceHeader("protectionResourceHeaderResource", new()
{
Key = "string",
Resource = "string",
Value = "string",
ProtectionResourceHeaderId = "string",
});
example, err := edgecenter.NewProtectionResourceHeader(ctx, "protectionResourceHeaderResource", &edgecenter.ProtectionResourceHeaderArgs{
Key: pulumi.String("string"),
Resource: pulumi.String("string"),
Value: pulumi.String("string"),
ProtectionResourceHeaderId: pulumi.String("string"),
})
var protectionResourceHeaderResource = new ProtectionResourceHeader("protectionResourceHeaderResource", ProtectionResourceHeaderArgs.builder()
.key("string")
.resource("string")
.value("string")
.protectionResourceHeaderId("string")
.build());
protection_resource_header_resource = edgecenter.ProtectionResourceHeader("protectionResourceHeaderResource",
key="string",
resource="string",
value="string",
protection_resource_header_id="string")
const protectionResourceHeaderResource = new edgecenter.ProtectionResourceHeader("protectionResourceHeaderResource", {
key: "string",
resource: "string",
value: "string",
protectionResourceHeaderId: "string",
});
type: edgecenter:ProtectionResourceHeader
properties:
key: string
protectionResourceHeaderId: string
resource: string
value: string
ProtectionResourceHeader Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProtectionResourceHeader resource accepts the following input properties:
- Key string
- HTTP header name.
- Resource string
- ID of the DDoS protection resource to add header to.
- Value string
- HTTP header value.
- Protection
Resource stringHeader Id - The ID of this resource.
- Key string
- HTTP header name.
- Resource string
- ID of the DDoS protection resource to add header to.
- Value string
- HTTP header value.
- Protection
Resource stringHeader Id - The ID of this resource.
- key String
- HTTP header name.
- resource String
- ID of the DDoS protection resource to add header to.
- value String
- HTTP header value.
- protection
Resource StringHeader Id - The ID of this resource.
- key string
- HTTP header name.
- resource string
- ID of the DDoS protection resource to add header to.
- value string
- HTTP header value.
- protection
Resource stringHeader Id - The ID of this resource.
- key str
- HTTP header name.
- resource str
- ID of the DDoS protection resource to add header to.
- value str
- HTTP header value.
- protection_
resource_ strheader_ id - The ID of this resource.
- key String
- HTTP header name.
- resource String
- ID of the DDoS protection resource to add header to.
- value String
- HTTP header value.
- protection
Resource StringHeader Id - The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProtectionResourceHeader resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ProtectionResourceHeader Resource
Get an existing ProtectionResourceHeader resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProtectionResourceHeaderState, opts?: CustomResourceOptions): ProtectionResourceHeader
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
protection_resource_header_id: Optional[str] = None,
resource: Optional[str] = None,
value: Optional[str] = None) -> ProtectionResourceHeader
func GetProtectionResourceHeader(ctx *Context, name string, id IDInput, state *ProtectionResourceHeaderState, opts ...ResourceOption) (*ProtectionResourceHeader, error)
public static ProtectionResourceHeader Get(string name, Input<string> id, ProtectionResourceHeaderState? state, CustomResourceOptions? opts = null)
public static ProtectionResourceHeader get(String name, Output<String> id, ProtectionResourceHeaderState state, CustomResourceOptions options)
resources: _: type: edgecenter:ProtectionResourceHeader get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Key string
- HTTP header name.
- Protection
Resource stringHeader Id - The ID of this resource.
- Resource string
- ID of the DDoS protection resource to add header to.
- Value string
- HTTP header value.
- Key string
- HTTP header name.
- Protection
Resource stringHeader Id - The ID of this resource.
- Resource string
- ID of the DDoS protection resource to add header to.
- Value string
- HTTP header value.
- key String
- HTTP header name.
- protection
Resource StringHeader Id - The ID of this resource.
- resource String
- ID of the DDoS protection resource to add header to.
- value String
- HTTP header value.
- key string
- HTTP header name.
- protection
Resource stringHeader Id - The ID of this resource.
- resource string
- ID of the DDoS protection resource to add header to.
- value string
- HTTP header value.
- key str
- HTTP header name.
- protection_
resource_ strheader_ id - The ID of this resource.
- resource str
- ID of the DDoS protection resource to add header to.
- value str
- HTTP header value.
- key String
- HTTP header name.
- protection
Resource StringHeader Id - The ID of this resource.
- resource String
- ID of the DDoS protection resource to add header to.
- value String
- HTTP header value.
Import
import using <resource_id>:<header_id> format
$ pulumi import edgecenter:index/protectionResourceHeader:ProtectionResourceHeader header1 12345:67
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- edgecenter edge-center/terraform-provider-edgecenter
- License
- Notes
- This Pulumi package is based on the
edgecenter
Terraform Provider.