ucloud.AntiDdosIp
Explore with Pulumi AI
Provides an Anti-DDoS IP 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,
});
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)
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
}
_, err = ucloud.NewAntiDdosIp(ctx, "fooAntiDdosIp", &ucloud.AntiDdosIpArgs{
Comment: pulumi.String("test-acc-comment"),
InstanceId: fooAntiDdosInstance.AntiDdosInstanceId,
})
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,
});
});
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 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());
}
}
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}
Create AntiDdosIp Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AntiDdosIp(name: string, args: AntiDdosIpArgs, opts?: CustomResourceOptions);
@overload
def AntiDdosIp(resource_name: str,
args: AntiDdosIpArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AntiDdosIp(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
anti_ddos_ip_id: Optional[str] = None,
comment: Optional[str] = None)
func NewAntiDdosIp(ctx *Context, name string, args AntiDdosIpArgs, opts ...ResourceOption) (*AntiDdosIp, error)
public AntiDdosIp(string name, AntiDdosIpArgs args, CustomResourceOptions? opts = null)
public AntiDdosIp(String name, AntiDdosIpArgs args)
public AntiDdosIp(String name, AntiDdosIpArgs args, CustomResourceOptions options)
type: ucloud:AntiDdosIp
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 AntiDdosIpArgs
- 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 AntiDdosIpArgs
- 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 AntiDdosIpArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AntiDdosIpArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AntiDdosIpArgs
- 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 antiDdosIpResource = new Ucloud.AntiDdosIp("antiDdosIpResource", new()
{
InstanceId = "string",
AntiDdosIpId = "string",
Comment = "string",
});
example, err := ucloud.NewAntiDdosIp(ctx, "antiDdosIpResource", &ucloud.AntiDdosIpArgs{
InstanceId: pulumi.String("string"),
AntiDdosIpId: pulumi.String("string"),
Comment: pulumi.String("string"),
})
var antiDdosIpResource = new AntiDdosIp("antiDdosIpResource", AntiDdosIpArgs.builder()
.instanceId("string")
.antiDdosIpId("string")
.comment("string")
.build());
anti_ddos_ip_resource = ucloud.AntiDdosIp("antiDdosIpResource",
instance_id="string",
anti_ddos_ip_id="string",
comment="string")
const antiDdosIpResource = new ucloud.AntiDdosIp("antiDdosIpResource", {
instanceId: "string",
antiDdosIpId: "string",
comment: "string",
});
type: ucloud:AntiDdosIp
properties:
antiDdosIpId: string
comment: string
instanceId: string
AntiDdosIp 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 AntiDdosIp resource accepts the following input properties:
- Instance
Id string - ID of ucloud_anti_ddos_instance.
- Anti
Ddos stringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - Comment string
- Comment of the IP.
- Instance
Id string - ID of ucloud_anti_ddos_instance.
- Anti
Ddos stringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - Comment string
- Comment of the IP.
- instance
Id String - ID of ucloud_anti_ddos_instance.
- anti
Ddos StringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment String
- Comment of the IP.
- instance
Id string - ID of ucloud_anti_ddos_instance.
- anti
Ddos stringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment string
- Comment of the IP.
- instance_
id str - ID of ucloud_anti_ddos_instance.
- anti_
ddos_ strip_ id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment str
- Comment of the IP.
- instance
Id String - ID of ucloud_anti_ddos_instance.
- anti
Ddos StringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment String
- Comment of the IP.
Outputs
All input properties are implicitly available as output properties. Additionally, the AntiDdosIp resource produces the following output properties:
Look up Existing AntiDdosIp Resource
Get an existing AntiDdosIp 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?: AntiDdosIpState, opts?: CustomResourceOptions): AntiDdosIp
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
anti_ddos_ip_id: Optional[str] = None,
comment: Optional[str] = None,
domain: Optional[str] = None,
instance_id: Optional[str] = None,
ip: Optional[str] = None,
status: Optional[str] = None) -> AntiDdosIp
func GetAntiDdosIp(ctx *Context, name string, id IDInput, state *AntiDdosIpState, opts ...ResourceOption) (*AntiDdosIp, error)
public static AntiDdosIp Get(string name, Input<string> id, AntiDdosIpState? state, CustomResourceOptions? opts = null)
public static AntiDdosIp get(String name, Output<String> id, AntiDdosIpState state, CustomResourceOptions options)
resources: _: type: ucloud:AntiDdosIp 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.
- Anti
Ddos stringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - Comment string
- Comment of the IP.
- Domain string
- Corresponding domain of the IP.
- Instance
Id string - ID of ucloud_anti_ddos_instance.
- Ip string
- Status string
- Status of the IP. Possible values are
Pending
andSuccess
- Anti
Ddos stringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - Comment string
- Comment of the IP.
- Domain string
- Corresponding domain of the IP.
- Instance
Id string - ID of ucloud_anti_ddos_instance.
- Ip string
- Status string
- Status of the IP. Possible values are
Pending
andSuccess
- anti
Ddos StringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment String
- Comment of the IP.
- domain String
- Corresponding domain of the IP.
- instance
Id String - ID of ucloud_anti_ddos_instance.
- ip String
- status String
- Status of the IP. Possible values are
Pending
andSuccess
- anti
Ddos stringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment string
- Comment of the IP.
- domain string
- Corresponding domain of the IP.
- instance
Id string - ID of ucloud_anti_ddos_instance.
- ip string
- status string
- Status of the IP. Possible values are
Pending
andSuccess
- anti_
ddos_ strip_ id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment str
- Comment of the IP.
- domain str
- Corresponding domain of the IP.
- instance_
id str - ID of ucloud_anti_ddos_instance.
- ip str
- status str
- Status of the IP. Possible values are
Pending
andSuccess
- anti
Ddos StringIp Id - The ID of the resource ucloud_anti_ddos_ip, the format is
<instance_id>/<ip>
. - comment String
- Comment of the IP.
- domain String
- Corresponding domain of the IP.
- instance
Id String - ID of ucloud_anti_ddos_instance.
- ip String
- status String
- Status of the IP. Possible values are
Pending
andSuccess
Import
Anti-DDoS instance allowed domain can be imported using the <instance_id>/<ip>
, e.g.
$ pulumi import ucloud:index/antiDdosIp:AntiDdosIp example usecure_ghp-xxx/10.10.10.10
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.