1. Packages
  2. Ucloud Provider
  3. API Docs
  4. AntiDdosRule
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.AntiDdosRule

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    Provides an Anti-DDoS rule resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const fooAntiDdosInstance = new ucloud.AntiDdosInstance("fooAntiDdosInstance", {
        area: "EastChina",
        bandwidth: 80,
        baseDefenceValue: 30,
        dataCenter: "Zaozhuang",
        maxDefenceValue: 30,
    });
    const fooAntiDdosAllowedDomain = new ucloud.AntiDdosAllowedDomain("fooAntiDdosAllowedDomain", {
        comment: "test-acc-comment",
        domain: "ucloud.cn",
        instanceId: fooAntiDdosInstance.antiDdosInstanceId,
    });
    const fooAntiDdosIp = new ucloud.AntiDdosIp("fooAntiDdosIp", {
        comment: "test-acc-comment",
        instanceId: fooAntiDdosInstance.antiDdosInstanceId,
    });
    const fooAntiDdosRule = new ucloud.AntiDdosRule("fooAntiDdosRule", {
        backupServer: {
            ip: "127.0.0.1",
            port: "4321",
        },
        instanceId: fooAntiDdosInstance.antiDdosInstanceId,
        ip: fooAntiDdosIp.ip,
        port: 4321,
        realServerDetection: true,
        realServerType: "IP",
        realServers: [
            {
                address: "127.0.0.1",
                port: 4321,
            },
            {
                address: "127.0.0.2",
                port: 4321,
            },
        ],
        toaId: 100,
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    foo_anti_ddos_instance = ucloud.AntiDdosInstance("fooAntiDdosInstance",
        area="EastChina",
        bandwidth=80,
        base_defence_value=30,
        data_center="Zaozhuang",
        max_defence_value=30)
    foo_anti_ddos_allowed_domain = ucloud.AntiDdosAllowedDomain("fooAntiDdosAllowedDomain",
        comment="test-acc-comment",
        domain="ucloud.cn",
        instance_id=foo_anti_ddos_instance.anti_ddos_instance_id)
    foo_anti_ddos_ip = ucloud.AntiDdosIp("fooAntiDdosIp",
        comment="test-acc-comment",
        instance_id=foo_anti_ddos_instance.anti_ddos_instance_id)
    foo_anti_ddos_rule = ucloud.AntiDdosRule("fooAntiDdosRule",
        backup_server={
            "ip": "127.0.0.1",
            "port": "4321",
        },
        instance_id=foo_anti_ddos_instance.anti_ddos_instance_id,
        ip=foo_anti_ddos_ip.ip,
        port=4321,
        real_server_detection=True,
        real_server_type="IP",
        real_servers=[
            {
                "address": "127.0.0.1",
                "port": 4321,
            },
            {
                "address": "127.0.0.2",
                "port": 4321,
            },
        ],
        toa_id=100)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooAntiDdosInstance, err := ucloud.NewAntiDdosInstance(ctx, "fooAntiDdosInstance", &ucloud.AntiDdosInstanceArgs{
    			Area:             pulumi.String("EastChina"),
    			Bandwidth:        pulumi.Float64(80),
    			BaseDefenceValue: pulumi.Float64(30),
    			DataCenter:       pulumi.String("Zaozhuang"),
    			MaxDefenceValue:  pulumi.Float64(30),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ucloud.NewAntiDdosAllowedDomain(ctx, "fooAntiDdosAllowedDomain", &ucloud.AntiDdosAllowedDomainArgs{
    			Comment:    pulumi.String("test-acc-comment"),
    			Domain:     pulumi.String("ucloud.cn"),
    			InstanceId: fooAntiDdosInstance.AntiDdosInstanceId,
    		})
    		if err != nil {
    			return err
    		}
    		fooAntiDdosIp, err := ucloud.NewAntiDdosIp(ctx, "fooAntiDdosIp", &ucloud.AntiDdosIpArgs{
    			Comment:    pulumi.String("test-acc-comment"),
    			InstanceId: fooAntiDdosInstance.AntiDdosInstanceId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ucloud.NewAntiDdosRule(ctx, "fooAntiDdosRule", &ucloud.AntiDdosRuleArgs{
    			BackupServer: pulumi.StringMap{
    				"ip":   pulumi.String("127.0.0.1"),
    				"port": pulumi.String("4321"),
    			},
    			InstanceId:          fooAntiDdosInstance.AntiDdosInstanceId,
    			Ip:                  fooAntiDdosIp.Ip,
    			Port:                pulumi.Float64(4321),
    			RealServerDetection: pulumi.Bool(true),
    			RealServerType:      pulumi.String("IP"),
    			RealServers: ucloud.AntiDdosRuleRealServerArray{
    				&ucloud.AntiDdosRuleRealServerArgs{
    					Address: pulumi.String("127.0.0.1"),
    					Port:    pulumi.Float64(4321),
    				},
    				&ucloud.AntiDdosRuleRealServerArgs{
    					Address: pulumi.String("127.0.0.2"),
    					Port:    pulumi.Float64(4321),
    				},
    			},
    			ToaId: pulumi.Float64(100),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var fooAntiDdosInstance = new Ucloud.AntiDdosInstance("fooAntiDdosInstance", new()
        {
            Area = "EastChina",
            Bandwidth = 80,
            BaseDefenceValue = 30,
            DataCenter = "Zaozhuang",
            MaxDefenceValue = 30,
        });
    
        var fooAntiDdosAllowedDomain = new Ucloud.AntiDdosAllowedDomain("fooAntiDdosAllowedDomain", new()
        {
            Comment = "test-acc-comment",
            Domain = "ucloud.cn",
            InstanceId = fooAntiDdosInstance.AntiDdosInstanceId,
        });
    
        var fooAntiDdosIp = new Ucloud.AntiDdosIp("fooAntiDdosIp", new()
        {
            Comment = "test-acc-comment",
            InstanceId = fooAntiDdosInstance.AntiDdosInstanceId,
        });
    
        var fooAntiDdosRule = new Ucloud.AntiDdosRule("fooAntiDdosRule", new()
        {
            BackupServer = 
            {
                { "ip", "127.0.0.1" },
                { "port", "4321" },
            },
            InstanceId = fooAntiDdosInstance.AntiDdosInstanceId,
            Ip = fooAntiDdosIp.Ip,
            Port = 4321,
            RealServerDetection = true,
            RealServerType = "IP",
            RealServers = new[]
            {
                new Ucloud.Inputs.AntiDdosRuleRealServerArgs
                {
                    Address = "127.0.0.1",
                    Port = 4321,
                },
                new Ucloud.Inputs.AntiDdosRuleRealServerArgs
                {
                    Address = "127.0.0.2",
                    Port = 4321,
                },
            },
            ToaId = 100,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.AntiDdosInstance;
    import com.pulumi.ucloud.AntiDdosInstanceArgs;
    import com.pulumi.ucloud.AntiDdosAllowedDomain;
    import com.pulumi.ucloud.AntiDdosAllowedDomainArgs;
    import com.pulumi.ucloud.AntiDdosIp;
    import com.pulumi.ucloud.AntiDdosIpArgs;
    import com.pulumi.ucloud.AntiDdosRule;
    import com.pulumi.ucloud.AntiDdosRuleArgs;
    import com.pulumi.ucloud.inputs.AntiDdosRuleRealServerArgs;
    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 fooAntiDdosInstance = new AntiDdosInstance("fooAntiDdosInstance", AntiDdosInstanceArgs.builder()
                .area("EastChina")
                .bandwidth(80)
                .baseDefenceValue(30)
                .dataCenter("Zaozhuang")
                .maxDefenceValue(30)
                .build());
    
            var fooAntiDdosAllowedDomain = new AntiDdosAllowedDomain("fooAntiDdosAllowedDomain", AntiDdosAllowedDomainArgs.builder()
                .comment("test-acc-comment")
                .domain("ucloud.cn")
                .instanceId(fooAntiDdosInstance.antiDdosInstanceId())
                .build());
    
            var fooAntiDdosIp = new AntiDdosIp("fooAntiDdosIp", AntiDdosIpArgs.builder()
                .comment("test-acc-comment")
                .instanceId(fooAntiDdosInstance.antiDdosInstanceId())
                .build());
    
            var fooAntiDdosRule = new AntiDdosRule("fooAntiDdosRule", AntiDdosRuleArgs.builder()
                .backupServer(Map.ofEntries(
                    Map.entry("ip", "127.0.0.1"),
                    Map.entry("port", "4321")
                ))
                .instanceId(fooAntiDdosInstance.antiDdosInstanceId())
                .ip(fooAntiDdosIp.ip())
                .port(4321)
                .realServerDetection(true)
                .realServerType("IP")
                .realServers(            
                    AntiDdosRuleRealServerArgs.builder()
                        .address("127.0.0.1")
                        .port(4321)
                        .build(),
                    AntiDdosRuleRealServerArgs.builder()
                        .address("127.0.0.2")
                        .port(4321)
                        .build())
                .toaId(100)
                .build());
    
        }
    }
    
    resources:
      fooAntiDdosInstance:
        type: ucloud:AntiDdosInstance
        properties:
          area: EastChina
          bandwidth: 80
          baseDefenceValue: 30
          dataCenter: Zaozhuang
          maxDefenceValue: 30
      fooAntiDdosAllowedDomain:
        type: ucloud:AntiDdosAllowedDomain
        properties:
          comment: test-acc-comment
          domain: ucloud.cn
          instanceId: ${fooAntiDdosInstance.antiDdosInstanceId}
      fooAntiDdosIp:
        type: ucloud:AntiDdosIp
        properties:
          comment: test-acc-comment
          instanceId: ${fooAntiDdosInstance.antiDdosInstanceId}
      fooAntiDdosRule:
        type: ucloud:AntiDdosRule
        properties:
          backupServer:
            ip: 127.0.0.1
            port: '4321'
          instanceId: ${fooAntiDdosInstance.antiDdosInstanceId}
          ip: ${fooAntiDdosIp.ip}
          port: 4321
          realServerDetection: true
          realServerType: IP
          realServers:
            - address: 127.0.0.1
              port: 4321
            - address: 127.0.0.2
              port: 4321
          toaId: 100
    

    Create AntiDdosRule Resource

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

    Constructor syntax

    new AntiDdosRule(name: string, args: AntiDdosRuleArgs, opts?: CustomResourceOptions);
    @overload
    def AntiDdosRule(resource_name: str,
                     args: AntiDdosRuleArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def AntiDdosRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     instance_id: Optional[str] = None,
                     ip: Optional[str] = None,
                     real_server_type: Optional[str] = None,
                     real_servers: Optional[Sequence[AntiDdosRuleRealServerArgs]] = None,
                     anti_ddos_rule_id: Optional[str] = None,
                     backup_server: Optional[Mapping[str, str]] = None,
                     comment: Optional[str] = None,
                     port: Optional[float] = None,
                     real_server_detection: Optional[bool] = None,
                     toa_id: Optional[float] = None)
    func NewAntiDdosRule(ctx *Context, name string, args AntiDdosRuleArgs, opts ...ResourceOption) (*AntiDdosRule, error)
    public AntiDdosRule(string name, AntiDdosRuleArgs args, CustomResourceOptions? opts = null)
    public AntiDdosRule(String name, AntiDdosRuleArgs args)
    public AntiDdosRule(String name, AntiDdosRuleArgs args, CustomResourceOptions options)
    
    type: ucloud:AntiDdosRule
    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 AntiDdosRuleArgs
    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 AntiDdosRuleArgs
    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 AntiDdosRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AntiDdosRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AntiDdosRuleArgs
    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 antiDdosRuleResource = new Ucloud.AntiDdosRule("antiDdosRuleResource", new()
    {
        InstanceId = "string",
        Ip = "string",
        RealServerType = "string",
        RealServers = new[]
        {
            new Ucloud.Inputs.AntiDdosRuleRealServerArgs
            {
                Address = "string",
                Port = 0,
            },
        },
        AntiDdosRuleId = "string",
        BackupServer = 
        {
            { "string", "string" },
        },
        Comment = "string",
        Port = 0,
        RealServerDetection = false,
        ToaId = 0,
    });
    
    example, err := ucloud.NewAntiDdosRule(ctx, "antiDdosRuleResource", &ucloud.AntiDdosRuleArgs{
    	InstanceId:     pulumi.String("string"),
    	Ip:             pulumi.String("string"),
    	RealServerType: pulumi.String("string"),
    	RealServers: ucloud.AntiDdosRuleRealServerArray{
    		&ucloud.AntiDdosRuleRealServerArgs{
    			Address: pulumi.String("string"),
    			Port:    pulumi.Float64(0),
    		},
    	},
    	AntiDdosRuleId: pulumi.String("string"),
    	BackupServer: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Comment:             pulumi.String("string"),
    	Port:                pulumi.Float64(0),
    	RealServerDetection: pulumi.Bool(false),
    	ToaId:               pulumi.Float64(0),
    })
    
    var antiDdosRuleResource = new AntiDdosRule("antiDdosRuleResource", AntiDdosRuleArgs.builder()
        .instanceId("string")
        .ip("string")
        .realServerType("string")
        .realServers(AntiDdosRuleRealServerArgs.builder()
            .address("string")
            .port(0)
            .build())
        .antiDdosRuleId("string")
        .backupServer(Map.of("string", "string"))
        .comment("string")
        .port(0)
        .realServerDetection(false)
        .toaId(0)
        .build());
    
    anti_ddos_rule_resource = ucloud.AntiDdosRule("antiDdosRuleResource",
        instance_id="string",
        ip="string",
        real_server_type="string",
        real_servers=[{
            "address": "string",
            "port": 0,
        }],
        anti_ddos_rule_id="string",
        backup_server={
            "string": "string",
        },
        comment="string",
        port=0,
        real_server_detection=False,
        toa_id=0)
    
    const antiDdosRuleResource = new ucloud.AntiDdosRule("antiDdosRuleResource", {
        instanceId: "string",
        ip: "string",
        realServerType: "string",
        realServers: [{
            address: "string",
            port: 0,
        }],
        antiDdosRuleId: "string",
        backupServer: {
            string: "string",
        },
        comment: "string",
        port: 0,
        realServerDetection: false,
        toaId: 0,
    });
    
    type: ucloud:AntiDdosRule
    properties:
        antiDdosRuleId: string
        backupServer:
            string: string
        comment: string
        instanceId: string
        ip: string
        port: 0
        realServerDetection: false
        realServerType: string
        realServers:
            - address: string
              port: 0
        toaId: 0
    

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

    InstanceId string
    ID of ucloud_anti_ddos_instance.
    Ip string
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    RealServerType string
    Type of real server address, whose value can be IP or Domain.
    RealServers List<AntiDdosRuleRealServer>
    Real server list.
    AntiDdosRuleId string
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    BackupServer Dictionary<string, string>
    Backup server, which must be set when real_server_detection is true.
    Comment string
    Comment of the rule.
    Port double
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    RealServerDetection bool
    Whether to detect real server health status. Default is false.
    ToaId double
    ID of TOA for getting real client IP. Default is 200.
    InstanceId string
    ID of ucloud_anti_ddos_instance.
    Ip string
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    RealServerType string
    Type of real server address, whose value can be IP or Domain.
    RealServers []AntiDdosRuleRealServerArgs
    Real server list.
    AntiDdosRuleId string
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    BackupServer map[string]string
    Backup server, which must be set when real_server_detection is true.
    Comment string
    Comment of the rule.
    Port float64
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    RealServerDetection bool
    Whether to detect real server health status. Default is false.
    ToaId float64
    ID of TOA for getting real client IP. Default is 200.
    instanceId String
    ID of ucloud_anti_ddos_instance.
    ip String
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    realServerType String
    Type of real server address, whose value can be IP or Domain.
    realServers List<AntiDdosRuleRealServer>
    Real server list.
    antiDdosRuleId String
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backupServer Map<String,String>
    Backup server, which must be set when real_server_detection is true.
    comment String
    Comment of the rule.
    port Double
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    realServerDetection Boolean
    Whether to detect real server health status. Default is false.
    toaId Double
    ID of TOA for getting real client IP. Default is 200.
    instanceId string
    ID of ucloud_anti_ddos_instance.
    ip string
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    realServerType string
    Type of real server address, whose value can be IP or Domain.
    realServers AntiDdosRuleRealServer[]
    Real server list.
    antiDdosRuleId string
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backupServer {[key: string]: string}
    Backup server, which must be set when real_server_detection is true.
    comment string
    Comment of the rule.
    port number
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    realServerDetection boolean
    Whether to detect real server health status. Default is false.
    toaId number
    ID of TOA for getting real client IP. Default is 200.
    instance_id str
    ID of ucloud_anti_ddos_instance.
    ip str
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    real_server_type str
    Type of real server address, whose value can be IP or Domain.
    real_servers Sequence[AntiDdosRuleRealServerArgs]
    Real server list.
    anti_ddos_rule_id str
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backup_server Mapping[str, str]
    Backup server, which must be set when real_server_detection is true.
    comment str
    Comment of the rule.
    port float
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    real_server_detection bool
    Whether to detect real server health status. Default is false.
    toa_id float
    ID of TOA for getting real client IP. Default is 200.
    instanceId String
    ID of ucloud_anti_ddos_instance.
    ip String
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    realServerType String
    Type of real server address, whose value can be IP or Domain.
    realServers List<Property Map>
    Real server list.
    antiDdosRuleId String
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backupServer Map<String>
    Backup server, which must be set when real_server_detection is true.
    comment String
    Comment of the rule.
    port Number
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    realServerDetection Boolean
    Whether to detect real server health status. Default is false.
    toaId Number
    ID of TOA for getting real client IP. Default is 200.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AntiDdosRule resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId string
    RuleIndex double
    Status string
    Status of the IP. Possible values are Pending, Success and Failed.
    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId string
    RuleIndex float64
    Status string
    Status of the IP. Possible values are Pending, Success and Failed.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId String
    ruleIndex Double
    status String
    Status of the IP. Possible values are Pending, Success and Failed.
    id string
    The provider-assigned unique ID for this managed resource.
    ruleId string
    ruleIndex number
    status string
    Status of the IP. Possible values are Pending, Success and Failed.
    id str
    The provider-assigned unique ID for this managed resource.
    rule_id str
    rule_index float
    status str
    Status of the IP. Possible values are Pending, Success and Failed.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId String
    ruleIndex Number
    status String
    Status of the IP. Possible values are Pending, Success and Failed.

    Look up Existing AntiDdosRule Resource

    Get an existing AntiDdosRule 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?: AntiDdosRuleState, opts?: CustomResourceOptions): AntiDdosRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            anti_ddos_rule_id: Optional[str] = None,
            backup_server: Optional[Mapping[str, str]] = None,
            comment: Optional[str] = None,
            instance_id: Optional[str] = None,
            ip: Optional[str] = None,
            port: Optional[float] = None,
            real_server_detection: Optional[bool] = None,
            real_server_type: Optional[str] = None,
            real_servers: Optional[Sequence[AntiDdosRuleRealServerArgs]] = None,
            rule_id: Optional[str] = None,
            rule_index: Optional[float] = None,
            status: Optional[str] = None,
            toa_id: Optional[float] = None) -> AntiDdosRule
    func GetAntiDdosRule(ctx *Context, name string, id IDInput, state *AntiDdosRuleState, opts ...ResourceOption) (*AntiDdosRule, error)
    public static AntiDdosRule Get(string name, Input<string> id, AntiDdosRuleState? state, CustomResourceOptions? opts = null)
    public static AntiDdosRule get(String name, Output<String> id, AntiDdosRuleState state, CustomResourceOptions options)
    resources:  _:    type: ucloud:AntiDdosRule    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:
    AntiDdosRuleId string
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    BackupServer Dictionary<string, string>
    Backup server, which must be set when real_server_detection is true.
    Comment string
    Comment of the rule.
    InstanceId string
    ID of ucloud_anti_ddos_instance.
    Ip string
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    Port double
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    RealServerDetection bool
    Whether to detect real server health status. Default is false.
    RealServerType string
    Type of real server address, whose value can be IP or Domain.
    RealServers List<AntiDdosRuleRealServer>
    Real server list.
    RuleId string
    RuleIndex double
    Status string
    Status of the IP. Possible values are Pending, Success and Failed.
    ToaId double
    ID of TOA for getting real client IP. Default is 200.
    AntiDdosRuleId string
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    BackupServer map[string]string
    Backup server, which must be set when real_server_detection is true.
    Comment string
    Comment of the rule.
    InstanceId string
    ID of ucloud_anti_ddos_instance.
    Ip string
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    Port float64
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    RealServerDetection bool
    Whether to detect real server health status. Default is false.
    RealServerType string
    Type of real server address, whose value can be IP or Domain.
    RealServers []AntiDdosRuleRealServerArgs
    Real server list.
    RuleId string
    RuleIndex float64
    Status string
    Status of the IP. Possible values are Pending, Success and Failed.
    ToaId float64
    ID of TOA for getting real client IP. Default is 200.
    antiDdosRuleId String
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backupServer Map<String,String>
    Backup server, which must be set when real_server_detection is true.
    comment String
    Comment of the rule.
    instanceId String
    ID of ucloud_anti_ddos_instance.
    ip String
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    port Double
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    realServerDetection Boolean
    Whether to detect real server health status. Default is false.
    realServerType String
    Type of real server address, whose value can be IP or Domain.
    realServers List<AntiDdosRuleRealServer>
    Real server list.
    ruleId String
    ruleIndex Double
    status String
    Status of the IP. Possible values are Pending, Success and Failed.
    toaId Double
    ID of TOA for getting real client IP. Default is 200.
    antiDdosRuleId string
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backupServer {[key: string]: string}
    Backup server, which must be set when real_server_detection is true.
    comment string
    Comment of the rule.
    instanceId string
    ID of ucloud_anti_ddos_instance.
    ip string
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    port number
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    realServerDetection boolean
    Whether to detect real server health status. Default is false.
    realServerType string
    Type of real server address, whose value can be IP or Domain.
    realServers AntiDdosRuleRealServer[]
    Real server list.
    ruleId string
    ruleIndex number
    status string
    Status of the IP. Possible values are Pending, Success and Failed.
    toaId number
    ID of TOA for getting real client IP. Default is 200.
    anti_ddos_rule_id str
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backup_server Mapping[str, str]
    Backup server, which must be set when real_server_detection is true.
    comment str
    Comment of the rule.
    instance_id str
    ID of ucloud_anti_ddos_instance.
    ip str
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    port float
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    real_server_detection bool
    Whether to detect real server health status. Default is false.
    real_server_type str
    Type of real server address, whose value can be IP or Domain.
    real_servers Sequence[AntiDdosRuleRealServerArgs]
    Real server list.
    rule_id str
    rule_index float
    status str
    Status of the IP. Possible values are Pending, Success and Failed.
    toa_id float
    ID of TOA for getting real client IP. Default is 200.
    antiDdosRuleId String
    The ID of the resource ucloud_anti_ddos_rule, the format is <instance_id>/<ip> for IP protocol rule or <instance_id>/<ip>/<port> for TCP protocol rule.
    backupServer Map<String>
    Backup server, which must be set when real_server_detection is true.
    comment String
    Comment of the rule.
    instanceId String
    ID of ucloud_anti_ddos_instance.
    ip String
    IP, where the rule is applied. The value can be got from the IP attribute of ucloud_anti_ddos_ip.
    port Number
    Port, where the rule is applied. When port is not set or set zero, the Anti-DDoS instance just forwards traffic in layer-3, otherwise it forwards traffic in layer-4.
    realServerDetection Boolean
    Whether to detect real server health status. Default is false.
    realServerType String
    Type of real server address, whose value can be IP or Domain.
    realServers List<Property Map>
    Real server list.
    ruleId String
    ruleIndex Number
    status String
    Status of the IP. Possible values are Pending, Success and Failed.
    toaId Number
    ID of TOA for getting real client IP. Default is 200.

    Supporting Types

    AntiDdosRuleRealServer, AntiDdosRuleRealServerArgs

    Address string
    Real server IP.
    Port double
    Real server port.
    Address string
    Real server IP.
    Port float64
    Real server port.
    address String
    Real server IP.
    port Double
    Real server port.
    address string
    Real server IP.
    port number
    Real server port.
    address str
    Real server IP.
    port float
    Real server port.
    address String
    Real server IP.
    port Number
    Real server port.

    Import

    Anti-DDoS instance allowed domain can be imported using the <instance_id>/<ip> or <instance_id>/<ip>/<port>, e.g.

    $ pulumi import ucloud:index/antiDdosRule:AntiDdosRule example usecure_ghp-xxx/10.10.10.10/4321
    

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

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud