1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ddos
  5. BasicDefenseThreshold
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.ddos.BasicDefenseThreshold

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a Ddos Basic defense threshold resource.

    For information about Ddos Basic Antiddos and how to use it, see What is Defense Threshold.

    NOTE: Available since v1.168.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const _default = new alicloud.ecs.EipAddress("default", {
        addressName: name,
        isp: "BGP",
        internetChargeType: "PayByBandwidth",
        paymentType: "PayAsYouGo",
    });
    const defaultBasicDefenseThreshold = new alicloud.ddos.BasicDefenseThreshold("default", {
        instanceId: _default.id,
        ddosType: "defense",
        instanceType: "eip",
        bps: 390,
        pps: 90000,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.ecs.EipAddress("default",
        address_name=name,
        isp="BGP",
        internet_charge_type="PayByBandwidth",
        payment_type="PayAsYouGo")
    default_basic_defense_threshold = alicloud.ddos.BasicDefenseThreshold("default",
        instance_id=default.id,
        ddos_type="defense",
        instance_type="eip",
        bps=390,
        pps=90000)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ddos"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"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, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := ecs.NewEipAddress(ctx, "default", &ecs.EipAddressArgs{
    			AddressName:        pulumi.String(name),
    			Isp:                pulumi.String("BGP"),
    			InternetChargeType: pulumi.String("PayByBandwidth"),
    			PaymentType:        pulumi.String("PayAsYouGo"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ddos.NewBasicDefenseThreshold(ctx, "default", &ddos.BasicDefenseThresholdArgs{
    			InstanceId:   _default.ID(),
    			DdosType:     pulumi.String("defense"),
    			InstanceType: pulumi.String("eip"),
    			Bps:          pulumi.Int(390),
    			Pps:          pulumi.Int(90000),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = new AliCloud.Ecs.EipAddress("default", new()
        {
            AddressName = name,
            Isp = "BGP",
            InternetChargeType = "PayByBandwidth",
            PaymentType = "PayAsYouGo",
        });
    
        var defaultBasicDefenseThreshold = new AliCloud.Ddos.BasicDefenseThreshold("default", new()
        {
            InstanceId = @default.Id,
            DdosType = "defense",
            InstanceType = "eip",
            Bps = 390,
            Pps = 90000,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EipAddress;
    import com.pulumi.alicloud.ecs.EipAddressArgs;
    import com.pulumi.alicloud.ddos.BasicDefenseThreshold;
    import com.pulumi.alicloud.ddos.BasicDefenseThresholdArgs;
    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 name = config.get("name").orElse("tf-example");
            var default_ = new EipAddress("default", EipAddressArgs.builder()
                .addressName(name)
                .isp("BGP")
                .internetChargeType("PayByBandwidth")
                .paymentType("PayAsYouGo")
                .build());
    
            var defaultBasicDefenseThreshold = new BasicDefenseThreshold("defaultBasicDefenseThreshold", BasicDefenseThresholdArgs.builder()
                .instanceId(default_.id())
                .ddosType("defense")
                .instanceType("eip")
                .bps(390)
                .pps(90000)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      default:
        type: alicloud:ecs:EipAddress
        properties:
          addressName: ${name}
          isp: BGP
          internetChargeType: PayByBandwidth
          paymentType: PayAsYouGo
      defaultBasicDefenseThreshold:
        type: alicloud:ddos:BasicDefenseThreshold
        name: default
        properties:
          instanceId: ${default.id}
          ddosType: defense
          instanceType: eip
          bps: 390
          pps: 90000
    

    Create BasicDefenseThreshold Resource

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

    Constructor syntax

    new BasicDefenseThreshold(name: string, args: BasicDefenseThresholdArgs, opts?: CustomResourceOptions);
    @overload
    def BasicDefenseThreshold(resource_name: str,
                              args: BasicDefenseThresholdArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def BasicDefenseThreshold(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              ddos_type: Optional[str] = None,
                              instance_id: Optional[str] = None,
                              instance_type: Optional[str] = None,
                              bps: Optional[int] = None,
                              internet_ip: Optional[str] = None,
                              is_auto: Optional[bool] = None,
                              pps: Optional[int] = None)
    func NewBasicDefenseThreshold(ctx *Context, name string, args BasicDefenseThresholdArgs, opts ...ResourceOption) (*BasicDefenseThreshold, error)
    public BasicDefenseThreshold(string name, BasicDefenseThresholdArgs args, CustomResourceOptions? opts = null)
    public BasicDefenseThreshold(String name, BasicDefenseThresholdArgs args)
    public BasicDefenseThreshold(String name, BasicDefenseThresholdArgs args, CustomResourceOptions options)
    
    type: alicloud:ddos:BasicDefenseThreshold
    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 BasicDefenseThresholdArgs
    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 BasicDefenseThresholdArgs
    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 BasicDefenseThresholdArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BasicDefenseThresholdArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BasicDefenseThresholdArgs
    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 basicDefenseThresholdResource = new AliCloud.Ddos.BasicDefenseThreshold("basicDefenseThresholdResource", new()
    {
        DdosType = "string",
        InstanceId = "string",
        InstanceType = "string",
        Bps = 0,
        InternetIp = "string",
        IsAuto = false,
        Pps = 0,
    });
    
    example, err := ddos.NewBasicDefenseThreshold(ctx, "basicDefenseThresholdResource", &ddos.BasicDefenseThresholdArgs{
    	DdosType:     pulumi.String("string"),
    	InstanceId:   pulumi.String("string"),
    	InstanceType: pulumi.String("string"),
    	Bps:          pulumi.Int(0),
    	InternetIp:   pulumi.String("string"),
    	IsAuto:       pulumi.Bool(false),
    	Pps:          pulumi.Int(0),
    })
    
    var basicDefenseThresholdResource = new BasicDefenseThreshold("basicDefenseThresholdResource", BasicDefenseThresholdArgs.builder()
        .ddosType("string")
        .instanceId("string")
        .instanceType("string")
        .bps(0)
        .internetIp("string")
        .isAuto(false)
        .pps(0)
        .build());
    
    basic_defense_threshold_resource = alicloud.ddos.BasicDefenseThreshold("basicDefenseThresholdResource",
        ddos_type="string",
        instance_id="string",
        instance_type="string",
        bps=0,
        internet_ip="string",
        is_auto=False,
        pps=0)
    
    const basicDefenseThresholdResource = new alicloud.ddos.BasicDefenseThreshold("basicDefenseThresholdResource", {
        ddosType: "string",
        instanceId: "string",
        instanceType: "string",
        bps: 0,
        internetIp: "string",
        isAuto: false,
        pps: 0,
    });
    
    type: alicloud:ddos:BasicDefenseThreshold
    properties:
        bps: 0
        ddosType: string
        instanceId: string
        instanceType: string
        internetIp: string
        isAuto: false
        pps: 0
    

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

    DdosType string
    The type of the threshold to query. Valid values: defense,blackhole.
    InstanceId string
    The ID of the instance.
    InstanceType string
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    Bps int
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    InternetIp string
    The Internet IP address.
    IsAuto bool
    Whether it is the system default threshold. Value:
    Pps int
    The current message number cleaning threshold. Unit: pps.
    DdosType string
    The type of the threshold to query. Valid values: defense,blackhole.
    InstanceId string
    The ID of the instance.
    InstanceType string
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    Bps int
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    InternetIp string
    The Internet IP address.
    IsAuto bool
    Whether it is the system default threshold. Value:
    Pps int
    The current message number cleaning threshold. Unit: pps.
    ddosType String
    The type of the threshold to query. Valid values: defense,blackhole.
    instanceId String
    The ID of the instance.
    instanceType String
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    bps Integer
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    internetIp String
    The Internet IP address.
    isAuto Boolean
    Whether it is the system default threshold. Value:
    pps Integer
    The current message number cleaning threshold. Unit: pps.
    ddosType string
    The type of the threshold to query. Valid values: defense,blackhole.
    instanceId string
    The ID of the instance.
    instanceType string
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    bps number
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    internetIp string
    The Internet IP address.
    isAuto boolean
    Whether it is the system default threshold. Value:
    pps number
    The current message number cleaning threshold. Unit: pps.
    ddos_type str
    The type of the threshold to query. Valid values: defense,blackhole.
    instance_id str
    The ID of the instance.
    instance_type str
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    bps int
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    internet_ip str
    The Internet IP address.
    is_auto bool
    Whether it is the system default threshold. Value:
    pps int
    The current message number cleaning threshold. Unit: pps.
    ddosType String
    The type of the threshold to query. Valid values: defense,blackhole.
    instanceId String
    The ID of the instance.
    instanceType String
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    bps Number
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    internetIp String
    The Internet IP address.
    isAuto Boolean
    Whether it is the system default threshold. Value:
    pps Number
    The current message number cleaning threshold. Unit: pps.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    MaxBps int
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    MaxPps int
    The maximum packet scrubbing threshold. Unit: pps.
    Id string
    The provider-assigned unique ID for this managed resource.
    MaxBps int
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    MaxPps int
    The maximum packet scrubbing threshold. Unit: pps.
    id String
    The provider-assigned unique ID for this managed resource.
    maxBps Integer
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    maxPps Integer
    The maximum packet scrubbing threshold. Unit: pps.
    id string
    The provider-assigned unique ID for this managed resource.
    maxBps number
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    maxPps number
    The maximum packet scrubbing threshold. Unit: pps.
    id str
    The provider-assigned unique ID for this managed resource.
    max_bps int
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    max_pps int
    The maximum packet scrubbing threshold. Unit: pps.
    id String
    The provider-assigned unique ID for this managed resource.
    maxBps Number
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    maxPps Number
    The maximum packet scrubbing threshold. Unit: pps.

    Look up Existing BasicDefenseThreshold Resource

    Get an existing BasicDefenseThreshold 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?: BasicDefenseThresholdState, opts?: CustomResourceOptions): BasicDefenseThreshold
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bps: Optional[int] = None,
            ddos_type: Optional[str] = None,
            instance_id: Optional[str] = None,
            instance_type: Optional[str] = None,
            internet_ip: Optional[str] = None,
            is_auto: Optional[bool] = None,
            max_bps: Optional[int] = None,
            max_pps: Optional[int] = None,
            pps: Optional[int] = None) -> BasicDefenseThreshold
    func GetBasicDefenseThreshold(ctx *Context, name string, id IDInput, state *BasicDefenseThresholdState, opts ...ResourceOption) (*BasicDefenseThreshold, error)
    public static BasicDefenseThreshold Get(string name, Input<string> id, BasicDefenseThresholdState? state, CustomResourceOptions? opts = null)
    public static BasicDefenseThreshold get(String name, Output<String> id, BasicDefenseThresholdState 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:
    Bps int
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    DdosType string
    The type of the threshold to query. Valid values: defense,blackhole.
    InstanceId string
    The ID of the instance.
    InstanceType string
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    InternetIp string
    The Internet IP address.
    IsAuto bool
    Whether it is the system default threshold. Value:
    MaxBps int
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    MaxPps int
    The maximum packet scrubbing threshold. Unit: pps.
    Pps int
    The current message number cleaning threshold. Unit: pps.
    Bps int
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    DdosType string
    The type of the threshold to query. Valid values: defense,blackhole.
    InstanceId string
    The ID of the instance.
    InstanceType string
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    InternetIp string
    The Internet IP address.
    IsAuto bool
    Whether it is the system default threshold. Value:
    MaxBps int
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    MaxPps int
    The maximum packet scrubbing threshold. Unit: pps.
    Pps int
    The current message number cleaning threshold. Unit: pps.
    bps Integer
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    ddosType String
    The type of the threshold to query. Valid values: defense,blackhole.
    instanceId String
    The ID of the instance.
    instanceType String
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    internetIp String
    The Internet IP address.
    isAuto Boolean
    Whether it is the system default threshold. Value:
    maxBps Integer
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    maxPps Integer
    The maximum packet scrubbing threshold. Unit: pps.
    pps Integer
    The current message number cleaning threshold. Unit: pps.
    bps number
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    ddosType string
    The type of the threshold to query. Valid values: defense,blackhole.
    instanceId string
    The ID of the instance.
    instanceType string
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    internetIp string
    The Internet IP address.
    isAuto boolean
    Whether it is the system default threshold. Value:
    maxBps number
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    maxPps number
    The maximum packet scrubbing threshold. Unit: pps.
    pps number
    The current message number cleaning threshold. Unit: pps.
    bps int
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    ddos_type str
    The type of the threshold to query. Valid values: defense,blackhole.
    instance_id str
    The ID of the instance.
    instance_type str
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    internet_ip str
    The Internet IP address.
    is_auto bool
    Whether it is the system default threshold. Value:
    max_bps int
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    max_pps int
    The maximum packet scrubbing threshold. Unit: pps.
    pps int
    The current message number cleaning threshold. Unit: pps.
    bps Number
    Specifies the traffic scrubbing threshold. Unit: Mbit/s. The traffic scrubbing threshold cannot exceed the peak inbound or outbound Internet traffic, whichever is larger, of the asset.
    ddosType String
    The type of the threshold to query. Valid values: defense,blackhole.
    instanceId String
    The ID of the instance.
    instanceType String
    The instance type of the public IP address asset. Value: ecs,slb,eip.
    internetIp String
    The Internet IP address.
    isAuto Boolean
    Whether it is the system default threshold. Value:
    maxBps Number
    The maximum traffic scrubbing threshold. Unit: Mbit/s.
    maxPps Number
    The maximum packet scrubbing threshold. Unit: pps.
    pps Number
    The current message number cleaning threshold. Unit: pps.

    Import

    Ddos Basic Antiddos can be imported using the id, e.g.

    $ pulumi import alicloud:ddos/basicDefenseThreshold:BasicDefenseThreshold example <instance_id>:<instance_type>:<ddos_type>
    

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

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi