1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TeoDdosProtectionConfig
tencentcloud 1.82.17 published on Thursday, Aug 14, 2025 by tencentcloudstack

tencentcloud.TeoDdosProtectionConfig

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.82.17 published on Thursday, Aug 14, 2025 by tencentcloudstack

    Provides a resource to create a TEO ddos protection config

    NOTE: If protection_option is protect_specified_domains, then all domains need to be listed. For domains that do not need protection, just set the switch to off.

    Example Usage

    Protect all domains

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.TeoDdosProtectionConfig("example", {
        ddosProtection: {
            protectionOption: "protect_all_domains",
        },
        zoneId: "zone-3edjdliiw3he",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.TeoDdosProtectionConfig("example",
        ddos_protection={
            "protection_option": "protect_all_domains",
        },
        zone_id="zone-3edjdliiw3he")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewTeoDdosProtectionConfig(ctx, "example", &tencentcloud.TeoDdosProtectionConfigArgs{
    			DdosProtection: &tencentcloud.TeoDdosProtectionConfigDdosProtectionArgs{
    				ProtectionOption: pulumi.String("protect_all_domains"),
    			},
    			ZoneId: pulumi.String("zone-3edjdliiw3he"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.TeoDdosProtectionConfig("example", new()
        {
            DdosProtection = new Tencentcloud.Inputs.TeoDdosProtectionConfigDdosProtectionArgs
            {
                ProtectionOption = "protect_all_domains",
            },
            ZoneId = "zone-3edjdliiw3he",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TeoDdosProtectionConfig;
    import com.pulumi.tencentcloud.TeoDdosProtectionConfigArgs;
    import com.pulumi.tencentcloud.inputs.TeoDdosProtectionConfigDdosProtectionArgs;
    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 example = new TeoDdosProtectionConfig("example", TeoDdosProtectionConfigArgs.builder()
                .ddosProtection(TeoDdosProtectionConfigDdosProtectionArgs.builder()
                    .protectionOption("protect_all_domains")
                    .build())
                .zoneId("zone-3edjdliiw3he")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:TeoDdosProtectionConfig
        properties:
          ddosProtection:
            protectionOption: protect_all_domains
          zoneId: zone-3edjdliiw3he
    

    Protect designated domains

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.TeoDdosProtectionConfig("example", {
        ddosProtection: {
            domainDdosProtections: [
                {
                    domain: "1.demo.com",
                    "switch": "on",
                },
                {
                    domain: "2.demo.com",
                    "switch": "on",
                },
                {
                    domain: "3.demo.com",
                    "switch": "off",
                },
            ],
            protectionOption: "protect_specified_domains",
        },
        zoneId: "zone-3edjdliiw3he",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.TeoDdosProtectionConfig("example",
        ddos_protection={
            "domain_ddos_protections": [
                {
                    "domain": "1.demo.com",
                    "switch": "on",
                },
                {
                    "domain": "2.demo.com",
                    "switch": "on",
                },
                {
                    "domain": "3.demo.com",
                    "switch": "off",
                },
            ],
            "protection_option": "protect_specified_domains",
        },
        zone_id="zone-3edjdliiw3he")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewTeoDdosProtectionConfig(ctx, "example", &tencentcloud.TeoDdosProtectionConfigArgs{
    			DdosProtection: &tencentcloud.TeoDdosProtectionConfigDdosProtectionArgs{
    				DomainDdosProtections: tencentcloud.TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArray{
    					&tencentcloud.TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs{
    						Domain: pulumi.String("1.demo.com"),
    						Switch: pulumi.String("on"),
    					},
    					&tencentcloud.TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs{
    						Domain: pulumi.String("2.demo.com"),
    						Switch: pulumi.String("on"),
    					},
    					&tencentcloud.TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs{
    						Domain: pulumi.String("3.demo.com"),
    						Switch: pulumi.String("off"),
    					},
    				},
    				ProtectionOption: pulumi.String("protect_specified_domains"),
    			},
    			ZoneId: pulumi.String("zone-3edjdliiw3he"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.TeoDdosProtectionConfig("example", new()
        {
            DdosProtection = new Tencentcloud.Inputs.TeoDdosProtectionConfigDdosProtectionArgs
            {
                DomainDdosProtections = new[]
                {
                    new Tencentcloud.Inputs.TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs
                    {
                        Domain = "1.demo.com",
                        Switch = "on",
                    },
                    new Tencentcloud.Inputs.TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs
                    {
                        Domain = "2.demo.com",
                        Switch = "on",
                    },
                    new Tencentcloud.Inputs.TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs
                    {
                        Domain = "3.demo.com",
                        Switch = "off",
                    },
                },
                ProtectionOption = "protect_specified_domains",
            },
            ZoneId = "zone-3edjdliiw3he",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TeoDdosProtectionConfig;
    import com.pulumi.tencentcloud.TeoDdosProtectionConfigArgs;
    import com.pulumi.tencentcloud.inputs.TeoDdosProtectionConfigDdosProtectionArgs;
    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 example = new TeoDdosProtectionConfig("example", TeoDdosProtectionConfigArgs.builder()
                .ddosProtection(TeoDdosProtectionConfigDdosProtectionArgs.builder()
                    .domainDdosProtections(                
                        TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs.builder()
                            .domain("1.demo.com")
                            .switch_("on")
                            .build(),
                        TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs.builder()
                            .domain("2.demo.com")
                            .switch_("on")
                            .build(),
                        TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs.builder()
                            .domain("3.demo.com")
                            .switch_("off")
                            .build())
                    .protectionOption("protect_specified_domains")
                    .build())
                .zoneId("zone-3edjdliiw3he")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:TeoDdosProtectionConfig
        properties:
          ddosProtection:
            domainDdosProtections:
              - domain: 1.demo.com
                switch: on
              - domain: 2.demo.com
                switch: on
              - domain: 3.demo.com
                switch: off
            protectionOption: protect_specified_domains
          zoneId: zone-3edjdliiw3he
    

    Create TeoDdosProtectionConfig Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TeoDdosProtectionConfig(name: string, args: TeoDdosProtectionConfigArgs, opts?: CustomResourceOptions);
    @overload
    def TeoDdosProtectionConfig(resource_name: str,
                                args: TeoDdosProtectionConfigArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def TeoDdosProtectionConfig(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                ddos_protection: Optional[TeoDdosProtectionConfigDdosProtectionArgs] = None,
                                zone_id: Optional[str] = None,
                                teo_ddos_protection_config_id: Optional[str] = None)
    func NewTeoDdosProtectionConfig(ctx *Context, name string, args TeoDdosProtectionConfigArgs, opts ...ResourceOption) (*TeoDdosProtectionConfig, error)
    public TeoDdosProtectionConfig(string name, TeoDdosProtectionConfigArgs args, CustomResourceOptions? opts = null)
    public TeoDdosProtectionConfig(String name, TeoDdosProtectionConfigArgs args)
    public TeoDdosProtectionConfig(String name, TeoDdosProtectionConfigArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TeoDdosProtectionConfig
    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 TeoDdosProtectionConfigArgs
    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 TeoDdosProtectionConfigArgs
    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 TeoDdosProtectionConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeoDdosProtectionConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeoDdosProtectionConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    TeoDdosProtectionConfig 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 TeoDdosProtectionConfig resource accepts the following input properties:

    DdosProtection TeoDdosProtectionConfigDdosProtection
    Specifies the exclusive Anti-DDoS configuration.
    ZoneId string
    Zone ID.
    TeoDdosProtectionConfigId string
    ID of the resource.
    DdosProtection TeoDdosProtectionConfigDdosProtectionArgs
    Specifies the exclusive Anti-DDoS configuration.
    ZoneId string
    Zone ID.
    TeoDdosProtectionConfigId string
    ID of the resource.
    ddosProtection TeoDdosProtectionConfigDdosProtection
    Specifies the exclusive Anti-DDoS configuration.
    zoneId String
    Zone ID.
    teoDdosProtectionConfigId String
    ID of the resource.
    ddosProtection TeoDdosProtectionConfigDdosProtection
    Specifies the exclusive Anti-DDoS configuration.
    zoneId string
    Zone ID.
    teoDdosProtectionConfigId string
    ID of the resource.
    ddos_protection TeoDdosProtectionConfigDdosProtectionArgs
    Specifies the exclusive Anti-DDoS configuration.
    zone_id str
    Zone ID.
    teo_ddos_protection_config_id str
    ID of the resource.
    ddosProtection Property Map
    Specifies the exclusive Anti-DDoS configuration.
    zoneId String
    Zone ID.
    teoDdosProtectionConfigId String
    ID of the resource.

    Outputs

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

    Get an existing TeoDdosProtectionConfig 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?: TeoDdosProtectionConfigState, opts?: CustomResourceOptions): TeoDdosProtectionConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ddos_protection: Optional[TeoDdosProtectionConfigDdosProtectionArgs] = None,
            teo_ddos_protection_config_id: Optional[str] = None,
            zone_id: Optional[str] = None) -> TeoDdosProtectionConfig
    func GetTeoDdosProtectionConfig(ctx *Context, name string, id IDInput, state *TeoDdosProtectionConfigState, opts ...ResourceOption) (*TeoDdosProtectionConfig, error)
    public static TeoDdosProtectionConfig Get(string name, Input<string> id, TeoDdosProtectionConfigState? state, CustomResourceOptions? opts = null)
    public static TeoDdosProtectionConfig get(String name, Output<String> id, TeoDdosProtectionConfigState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TeoDdosProtectionConfig    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.
    The following state arguments are supported:
    DdosProtection TeoDdosProtectionConfigDdosProtection
    Specifies the exclusive Anti-DDoS configuration.
    TeoDdosProtectionConfigId string
    ID of the resource.
    ZoneId string
    Zone ID.
    DdosProtection TeoDdosProtectionConfigDdosProtectionArgs
    Specifies the exclusive Anti-DDoS configuration.
    TeoDdosProtectionConfigId string
    ID of the resource.
    ZoneId string
    Zone ID.
    ddosProtection TeoDdosProtectionConfigDdosProtection
    Specifies the exclusive Anti-DDoS configuration.
    teoDdosProtectionConfigId String
    ID of the resource.
    zoneId String
    Zone ID.
    ddosProtection TeoDdosProtectionConfigDdosProtection
    Specifies the exclusive Anti-DDoS configuration.
    teoDdosProtectionConfigId string
    ID of the resource.
    zoneId string
    Zone ID.
    ddos_protection TeoDdosProtectionConfigDdosProtectionArgs
    Specifies the exclusive Anti-DDoS configuration.
    teo_ddos_protection_config_id str
    ID of the resource.
    zone_id str
    Zone ID.
    ddosProtection Property Map
    Specifies the exclusive Anti-DDoS configuration.
    teoDdosProtectionConfigId String
    ID of the resource.
    zoneId String
    Zone ID.

    Supporting Types

    TeoDdosProtectionConfigDdosProtection, TeoDdosProtectionConfigDdosProtectionArgs

    ProtectionOption string
    Specifies the protection scope of standalone DDoS. valid values:.

    DomainDdosProtections List<TeoDdosProtectionConfigDdosProtectionDomainDdosProtection>
    Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.

    SharedCnameDdosProtections List<TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtection>
    Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
    ProtectionOption string
    Specifies the protection scope of standalone DDoS. valid values:.

    DomainDdosProtections []TeoDdosProtectionConfigDdosProtectionDomainDdosProtection
    Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.

    SharedCnameDdosProtections []TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtection
    Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
    protectionOption String
    Specifies the protection scope of standalone DDoS. valid values:.

    domainDdosProtections List<TeoDdosProtectionConfigDdosProtectionDomainDdosProtection>
    Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.

    sharedCnameDdosProtections List<TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtection>
    Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
    protectionOption string
    Specifies the protection scope of standalone DDoS. valid values:.

    domainDdosProtections TeoDdosProtectionConfigDdosProtectionDomainDdosProtection[]
    Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.

    sharedCnameDdosProtections TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtection[]
    Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
    protection_option str
    Specifies the protection scope of standalone DDoS. valid values:.

    domain_ddos_protections Sequence[TeoDdosProtectionConfigDdosProtectionDomainDdosProtection]
    Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.

    shared_cname_ddos_protections Sequence[TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtection]
    Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
    protectionOption String
    Specifies the protection scope of standalone DDoS. valid values:.

    domainDdosProtections List<Property Map>
    Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.

    sharedCnameDdosProtections List<Property Map>
    Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.

    TeoDdosProtectionConfigDdosProtectionDomainDdosProtection, TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs

    Domain string
    Domain name.
    Switch string
    Standalone DDoS switch of the domain. valid values:.

    Domain string
    Domain name.
    Switch string
    Standalone DDoS switch of the domain. valid values:.

    domain String
    Domain name.
    switch_ String
    Standalone DDoS switch of the domain. valid values:.

    domain string
    Domain name.
    switch string
    Standalone DDoS switch of the domain. valid values:.

    domain str
    Domain name.
    switch str
    Standalone DDoS switch of the domain. valid values:.

    domain String
    Domain name.
    switch String
    Standalone DDoS switch of the domain. valid values:.

    TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtection, TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtectionArgs

    Domain string
    Switch string
    Domain string
    Switch string
    domain String
    switch_ String
    domain string
    switch string
    domain str
    switch str
    domain String
    switch String

    Import

    TEO ddos protection config can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/teoDdosProtectionConfig:TeoDdosProtectionConfig example zone-3edjdliiw3he
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.82.17 published on Thursday, Aug 14, 2025 by tencentcloudstack