1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dcdn
  5. WafDomain
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

alicloud.dcdn.WafDomain

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi

    Provides a DCDN Waf Domain resource.

    For information about DCDN Waf Domain and how to use it, see What is Waf Domain.

    NOTE: Available since v1.185.0.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var domainName = config.Get("domainName") ?? "example.com";
        var exampleDomain = new AliCloud.Dcdn.Domain("exampleDomain", new()
        {
            DomainName = domainName,
            Scope = "overseas",
            Sources = new[]
            {
                new AliCloud.Dcdn.Inputs.DomainSourceArgs
                {
                    Content = "1.1.1.1",
                    Port = 80,
                    Priority = "20",
                    Type = "ipaddr",
                    Weight = "10",
                },
            },
        });
    
        var exampleWafDomain = new AliCloud.Dcdn.WafDomain("exampleWafDomain", new()
        {
            DomainName = exampleDomain.DomainName,
            ClientIpTag = "X-Forwarded-For",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dcdn"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		domainName := "example.com"
    		if param := cfg.Get("domainName"); param != "" {
    			domainName = param
    		}
    		exampleDomain, err := dcdn.NewDomain(ctx, "exampleDomain", &dcdn.DomainArgs{
    			DomainName: pulumi.String(domainName),
    			Scope:      pulumi.String("overseas"),
    			Sources: dcdn.DomainSourceArray{
    				&dcdn.DomainSourceArgs{
    					Content:  pulumi.String("1.1.1.1"),
    					Port:     pulumi.Int(80),
    					Priority: pulumi.String("20"),
    					Type:     pulumi.String("ipaddr"),
    					Weight:   pulumi.String("10"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = dcdn.NewWafDomain(ctx, "exampleWafDomain", &dcdn.WafDomainArgs{
    			DomainName:  exampleDomain.DomainName,
    			ClientIpTag: pulumi.String("X-Forwarded-For"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.dcdn.Domain;
    import com.pulumi.alicloud.dcdn.DomainArgs;
    import com.pulumi.alicloud.dcdn.inputs.DomainSourceArgs;
    import com.pulumi.alicloud.dcdn.WafDomain;
    import com.pulumi.alicloud.dcdn.WafDomainArgs;
    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) {
            final var config = ctx.config();
            final var domainName = config.get("domainName").orElse("example.com");
            var exampleDomain = new Domain("exampleDomain", DomainArgs.builder()        
                .domainName(domainName)
                .scope("overseas")
                .sources(DomainSourceArgs.builder()
                    .content("1.1.1.1")
                    .port("80")
                    .priority("20")
                    .type("ipaddr")
                    .weight("10")
                    .build())
                .build());
    
            var exampleWafDomain = new WafDomain("exampleWafDomain", WafDomainArgs.builder()        
                .domainName(exampleDomain.domainName())
                .clientIpTag("X-Forwarded-For")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    domain_name = config.get("domainName")
    if domain_name is None:
        domain_name = "example.com"
    example_domain = alicloud.dcdn.Domain("exampleDomain",
        domain_name=domain_name,
        scope="overseas",
        sources=[alicloud.dcdn.DomainSourceArgs(
            content="1.1.1.1",
            port=80,
            priority="20",
            type="ipaddr",
            weight="10",
        )])
    example_waf_domain = alicloud.dcdn.WafDomain("exampleWafDomain",
        domain_name=example_domain.domain_name,
        client_ip_tag="X-Forwarded-For")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const domainName = config.get("domainName") || "example.com";
    const exampleDomain = new alicloud.dcdn.Domain("exampleDomain", {
        domainName: domainName,
        scope: "overseas",
        sources: [{
            content: "1.1.1.1",
            port: 80,
            priority: "20",
            type: "ipaddr",
            weight: "10",
        }],
    });
    const exampleWafDomain = new alicloud.dcdn.WafDomain("exampleWafDomain", {
        domainName: exampleDomain.domainName,
        clientIpTag: "X-Forwarded-For",
    });
    
    configuration:
      domainName:
        type: string
        default: example.com
    resources:
      exampleDomain:
        type: alicloud:dcdn:Domain
        properties:
          domainName: ${domainName}
          scope: overseas
          sources:
            - content: 1.1.1.1
              port: '80'
              priority: '20'
              type: ipaddr
              weight: '10'
      exampleWafDomain:
        type: alicloud:dcdn:WafDomain
        properties:
          domainName: ${exampleDomain.domainName}
          clientIpTag: X-Forwarded-For
    

    Create WafDomain Resource

    new WafDomain(name: string, args: WafDomainArgs, opts?: CustomResourceOptions);
    @overload
    def WafDomain(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  client_ip_tag: Optional[str] = None,
                  domain_name: Optional[str] = None)
    @overload
    def WafDomain(resource_name: str,
                  args: WafDomainArgs,
                  opts: Optional[ResourceOptions] = None)
    func NewWafDomain(ctx *Context, name string, args WafDomainArgs, opts ...ResourceOption) (*WafDomain, error)
    public WafDomain(string name, WafDomainArgs args, CustomResourceOptions? opts = null)
    public WafDomain(String name, WafDomainArgs args)
    public WafDomain(String name, WafDomainArgs args, CustomResourceOptions options)
    
    type: alicloud:dcdn:WafDomain
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args WafDomainArgs
    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 WafDomainArgs
    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 WafDomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WafDomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WafDomainArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    WafDomain Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The WafDomain resource accepts the following input properties:

    DomainName string

    The accelerated domain name.

    ClientIpTag string

    The client ip tag.

    DomainName string

    The accelerated domain name.

    ClientIpTag string

    The client ip tag.

    domainName String

    The accelerated domain name.

    clientIpTag String

    The client ip tag.

    domainName string

    The accelerated domain name.

    clientIpTag string

    The client ip tag.

    domain_name str

    The accelerated domain name.

    client_ip_tag str

    The client ip tag.

    domainName String

    The accelerated domain name.

    clientIpTag String

    The client ip tag.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WafDomain 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 WafDomain Resource

    Get an existing WafDomain 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?: WafDomainState, opts?: CustomResourceOptions): WafDomain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            client_ip_tag: Optional[str] = None,
            domain_name: Optional[str] = None) -> WafDomain
    func GetWafDomain(ctx *Context, name string, id IDInput, state *WafDomainState, opts ...ResourceOption) (*WafDomain, error)
    public static WafDomain Get(string name, Input<string> id, WafDomainState? state, CustomResourceOptions? opts = null)
    public static WafDomain get(String name, Output<String> id, WafDomainState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    ClientIpTag string

    The client ip tag.

    DomainName string

    The accelerated domain name.

    ClientIpTag string

    The client ip tag.

    DomainName string

    The accelerated domain name.

    clientIpTag String

    The client ip tag.

    domainName String

    The accelerated domain name.

    clientIpTag string

    The client ip tag.

    domainName string

    The accelerated domain name.

    client_ip_tag str

    The client ip tag.

    domain_name str

    The accelerated domain name.

    clientIpTag String

    The client ip tag.

    domainName String

    The accelerated domain name.

    Import

    DCDN Waf Domain can be imported using the id, e.g.

     $ pulumi import alicloud:dcdn/wafDomain:WafDomain example <domain_name>
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the alicloud Terraform Provider.

    alicloud logo
    Alibaba Cloud v3.45.0 published on Monday, Nov 27, 2023 by Pulumi