alicloud.ddos.BasicDefenseThreshold
Explore with Pulumi AI
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
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 defaultEipAddress = new AliCloud.Ecs.EipAddress("defaultEipAddress", new()
{
AddressName = name,
Isp = "BGP",
InternetChargeType = "PayByBandwidth",
PaymentType = "PayAsYouGo",
});
var defaultBasicDefenseThreshold = new AliCloud.Ddos.BasicDefenseThreshold("defaultBasicDefenseThreshold", new()
{
InstanceId = defaultEipAddress.Id,
DdosType = "defense",
InstanceType = "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
}
defaultEipAddress, err := ecs.NewEipAddress(ctx, "defaultEipAddress", &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, "defaultBasicDefenseThreshold", &ddos.BasicDefenseThresholdArgs{
InstanceId: defaultEipAddress.ID(),
DdosType: pulumi.String("defense"),
InstanceType: pulumi.String("eip"),
Bps: pulumi.Int(390),
Pps: pulumi.Int(90000),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.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 defaultEipAddress = new EipAddress("defaultEipAddress", EipAddressArgs.builder()
.addressName(name)
.isp("BGP")
.internetChargeType("PayByBandwidth")
.paymentType("PayAsYouGo")
.build());
var defaultBasicDefenseThreshold = new BasicDefenseThreshold("defaultBasicDefenseThreshold", BasicDefenseThresholdArgs.builder()
.instanceId(defaultEipAddress.id())
.ddosType("defense")
.instanceType("eip")
.bps(390)
.pps(90000)
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default_eip_address = alicloud.ecs.EipAddress("defaultEipAddress",
address_name=name,
isp="BGP",
internet_charge_type="PayByBandwidth",
payment_type="PayAsYouGo")
default_basic_defense_threshold = alicloud.ddos.BasicDefenseThreshold("defaultBasicDefenseThreshold",
instance_id=default_eip_address.id,
ddos_type="defense",
instance_type="eip",
bps=390,
pps=90000)
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 defaultEipAddress = new alicloud.ecs.EipAddress("defaultEipAddress", {
addressName: name,
isp: "BGP",
internetChargeType: "PayByBandwidth",
paymentType: "PayAsYouGo",
});
const defaultBasicDefenseThreshold = new alicloud.ddos.BasicDefenseThreshold("defaultBasicDefenseThreshold", {
instanceId: defaultEipAddress.id,
ddosType: "defense",
instanceType: "eip",
bps: 390,
pps: 90000,
});
configuration:
name:
type: string
default: tf-example
resources:
defaultEipAddress:
type: alicloud:ecs:EipAddress
properties:
addressName: ${name}
isp: BGP
internetChargeType: PayByBandwidth
paymentType: PayAsYouGo
defaultBasicDefenseThreshold:
type: alicloud:ddos:BasicDefenseThreshold
properties:
instanceId: ${defaultEipAddress.id}
ddosType: defense
instanceType: eip
bps: 390
pps: 90000
Create BasicDefenseThreshold Resource
new BasicDefenseThreshold(name: string, args: BasicDefenseThresholdArgs, opts?: CustomResourceOptions);
@overload
def BasicDefenseThreshold(resource_name: 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,
pps: Optional[int] = None)
@overload
def BasicDefenseThreshold(resource_name: str,
args: BasicDefenseThresholdArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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:
- Ddos
Type string The type of the threshold to query. Valid values:
defense
,blackhole
.- Instance
Id string The ID of the instance.
- Instance
Type 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.
- Internet
Ip string 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.
- Ddos
Type string The type of the threshold to query. Valid values:
defense
,blackhole
.- Instance
Id string The ID of the instance.
- Instance
Type 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.
- Internet
Ip string 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.
- ddos
Type String The type of the threshold to query. Valid values:
defense
,blackhole
.- instance
Id String The ID of the instance.
- instance
Type 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.
- internet
Ip String The Internet IP address.
- is
Auto Boolean Whether it is the system default threshold. Value:
- pps Integer
The current message number cleaning threshold. Unit: pps.
- ddos
Type string The type of the threshold to query. Valid values:
defense
,blackhole
.- instance
Id string The ID of the instance.
- instance
Type 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.
- internet
Ip string The Internet IP address.
- is
Auto 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.
- ddos
Type String The type of the threshold to query. Valid values:
defense
,blackhole
.- instance
Id String The ID of the instance.
- instance
Type 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.
- internet
Ip String The Internet IP address.
- is
Auto 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:
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.
- 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 string The type of the threshold to query. Valid values:
defense
,blackhole
.- Instance
Id string The ID of the instance.
- Instance
Type string The instance type of the public IP address asset. Value:
ecs
,slb
,eip
.- Internet
Ip string 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 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 string The type of the threshold to query. Valid values:
defense
,blackhole
.- Instance
Id string The ID of the instance.
- Instance
Type string The instance type of the public IP address asset. Value:
ecs
,slb
,eip
.- Internet
Ip string 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 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.
- ddos
Type String The type of the threshold to query. Valid values:
defense
,blackhole
.- instance
Id String The ID of the instance.
- instance
Type String The instance type of the public IP address asset. Value:
ecs
,slb
,eip
.- internet
Ip String The Internet IP address.
- is
Auto Boolean Whether it is the system default threshold. Value:
- max
Bps Integer The maximum traffic scrubbing threshold. Unit: Mbit/s.
- max
Pps 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.
- ddos
Type string The type of the threshold to query. Valid values:
defense
,blackhole
.- instance
Id string The ID of the instance.
- instance
Type string The instance type of the public IP address asset. Value:
ecs
,slb
,eip
.- internet
Ip string The Internet IP address.
- is
Auto boolean Whether it is the system default threshold. Value:
- max
Bps number The maximum traffic scrubbing threshold. Unit: Mbit/s.
- max
Pps 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.
- ddos
Type String The type of the threshold to query. Valid values:
defense
,blackhole
.- instance
Id String The ID of the instance.
- instance
Type String The instance type of the public IP address asset. Value:
ecs
,slb
,eip
.- internet
Ip String The Internet IP address.
- is
Auto Boolean Whether it is the system default threshold. Value:
- max
Bps Number The maximum traffic scrubbing threshold. Unit: Mbit/s.
- max
Pps 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>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.