tencentcloud.TeoDdosProtectionConfig
Explore with Pulumi AI
Provides a resource to create a TEO ddos protection config
NOTE: If
protection_option
isprotect_specified_domains
, then all domains need to be listed. For domains that do not need protection, just set theswitch
tooff
.
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:
- Ddos
Protection TeoDdos Protection Config Ddos Protection - Specifies the exclusive Anti-DDoS configuration.
- Zone
Id string - Zone ID.
- Teo
Ddos stringProtection Config Id - ID of the resource.
- Ddos
Protection TeoDdos Protection Config Ddos Protection Args - Specifies the exclusive Anti-DDoS configuration.
- Zone
Id string - Zone ID.
- Teo
Ddos stringProtection Config Id - ID of the resource.
- ddos
Protection TeoDdos Protection Config Ddos Protection - Specifies the exclusive Anti-DDoS configuration.
- zone
Id String - Zone ID.
- teo
Ddos StringProtection Config Id - ID of the resource.
- ddos
Protection TeoDdos Protection Config Ddos Protection - Specifies the exclusive Anti-DDoS configuration.
- zone
Id string - Zone ID.
- teo
Ddos stringProtection Config Id - ID of the resource.
- ddos_
protection TeoDdos Protection Config Ddos Protection Args - Specifies the exclusive Anti-DDoS configuration.
- zone_
id str - Zone ID.
- teo_
ddos_ strprotection_ config_ id - ID of the resource.
- ddos
Protection Property Map - Specifies the exclusive Anti-DDoS configuration.
- zone
Id String - Zone ID.
- teo
Ddos StringProtection Config Id - 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.
- Ddos
Protection TeoDdos Protection Config Ddos Protection - Specifies the exclusive Anti-DDoS configuration.
- Teo
Ddos stringProtection Config Id - ID of the resource.
- Zone
Id string - Zone ID.
- Ddos
Protection TeoDdos Protection Config Ddos Protection Args - Specifies the exclusive Anti-DDoS configuration.
- Teo
Ddos stringProtection Config Id - ID of the resource.
- Zone
Id string - Zone ID.
- ddos
Protection TeoDdos Protection Config Ddos Protection - Specifies the exclusive Anti-DDoS configuration.
- teo
Ddos StringProtection Config Id - ID of the resource.
- zone
Id String - Zone ID.
- ddos
Protection TeoDdos Protection Config Ddos Protection - Specifies the exclusive Anti-DDoS configuration.
- teo
Ddos stringProtection Config Id - ID of the resource.
- zone
Id string - Zone ID.
- ddos_
protection TeoDdos Protection Config Ddos Protection Args - Specifies the exclusive Anti-DDoS configuration.
- teo_
ddos_ strprotection_ config_ id - ID of the resource.
- zone_
id str - Zone ID.
- ddos
Protection Property Map - Specifies the exclusive Anti-DDoS configuration.
- teo
Ddos StringProtection Config Id - ID of the resource.
- zone
Id String - Zone ID.
Supporting Types
TeoDdosProtectionConfigDdosProtection, TeoDdosProtectionConfigDdosProtectionArgs
- Protection
Option string - Specifies the protection scope of standalone DDoS. valid values:.
- Domain
Ddos List<TeoProtections Ddos Protection Config Ddos Protection Domain Ddos Protection> - Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.
- List<Teo
Ddos Protection Config Ddos Protection Shared Cname Ddos Protection> - Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
- Protection
Option string - Specifies the protection scope of standalone DDoS. valid values:.
- Domain
Ddos []TeoProtections Ddos Protection Config Ddos Protection Domain Ddos Protection - Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.
- []Teo
Ddos Protection Config Ddos Protection Shared Cname Ddos Protection - Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
- protection
Option String - Specifies the protection scope of standalone DDoS. valid values:.
- domain
Ddos List<TeoProtections Ddos Protection Config Ddos Protection Domain Ddos Protection> - Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.
- List<Teo
Ddos Protection Config Ddos Protection Shared Cname Ddos Protection> - Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
- protection
Option string - Specifies the protection scope of standalone DDoS. valid values:.
- domain
Ddos TeoProtections Ddos Protection Config Ddos Protection Domain Ddos Protection[] - Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.
- Teo
Ddos Protection Config Ddos Protection Shared Cname Ddos Protection[] - 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_ Sequence[Teoprotections Ddos Protection Config Ddos Protection Domain Ddos Protection] - Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.
- Sequence[Teo
Ddos Protection Config Ddos Protection Shared Cname Ddos Protection] - Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
- protection
Option String - Specifies the protection scope of standalone DDoS. valid values:.
- domain
Ddos List<Property Map>Protections - Anti-DDoS configuration of the domain. specifies the exclusive ddos protection settings for the domain in request parameters.
- List<Property Map>
- Specifies the exclusive DDoS protection configuration of a shared CNAME. used as an output parameter.
TeoDdosProtectionConfigDdosProtectionDomainDdosProtection, TeoDdosProtectionConfigDdosProtectionDomainDdosProtectionArgs
TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtection, TeoDdosProtectionConfigDdosProtectionSharedCnameDdosProtectionArgs
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.