alicloud.ddos.BgpIp
Explore with Pulumi AI
Provides a Ddos Bgp Ip resource.
For information about Ddos Bgp Ip and how to use it, see What is Ip.
NOTE: Available since v1.180.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 = alicloud.resourcemanager.getResourceGroups({});
const current = alicloud.getAccount({});
const instance = new alicloud.ddos.DdosBgpInstance("instance", {
name: name,
baseBandwidth: 20,
bandwidth: -1,
ipCount: 100,
ipType: "IPv4",
normalBandwidth: 100,
type: "Enterprise",
});
const defaultEipAddress = new alicloud.ecs.EipAddress("default", {addressName: name});
const defaultBgpIp = new alicloud.ddos.BgpIp("default", {
instanceId: instance.id,
ip: defaultEipAddress.ipAddress,
resourceGroupId: _default.then(_default => _default.groups?.[0]?.id),
memberUid: current.then(current => current.id),
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.resourcemanager.get_resource_groups()
current = alicloud.get_account()
instance = alicloud.ddos.DdosBgpInstance("instance",
name=name,
base_bandwidth=20,
bandwidth=-1,
ip_count=100,
ip_type="IPv4",
normal_bandwidth=100,
type="Enterprise")
default_eip_address = alicloud.ecs.EipAddress("default", address_name=name)
default_bgp_ip = alicloud.ddos.BgpIp("default",
instance_id=instance.id,
ip=default_eip_address.ip_address,
resource_group_id=default.groups[0].id,
member_uid=current.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ddos"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"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
}
_default, err := resourcemanager.GetResourceGroups(ctx, nil, nil)
if err != nil {
return err
}
current, err := alicloud.GetAccount(ctx, nil, nil)
if err != nil {
return err
}
instance, err := ddos.NewDdosBgpInstance(ctx, "instance", &ddos.DdosBgpInstanceArgs{
Name: pulumi.String(name),
BaseBandwidth: pulumi.Int(20),
Bandwidth: -1,
IpCount: pulumi.Int(100),
IpType: pulumi.String("IPv4"),
NormalBandwidth: pulumi.Int(100),
Type: pulumi.String("Enterprise"),
})
if err != nil {
return err
}
defaultEipAddress, err := ecs.NewEipAddress(ctx, "default", &ecs.EipAddressArgs{
AddressName: pulumi.String(name),
})
if err != nil {
return err
}
_, err = ddos.NewBgpIp(ctx, "default", &ddos.BgpIpArgs{
InstanceId: instance.ID(),
Ip: defaultEipAddress.IpAddress,
ResourceGroupId: pulumi.String(_default.Groups[0].Id),
MemberUid: pulumi.String(current.Id),
})
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 = AliCloud.ResourceManager.GetResourceGroups.Invoke();
var current = AliCloud.GetAccount.Invoke();
var instance = new AliCloud.Ddos.DdosBgpInstance("instance", new()
{
Name = name,
BaseBandwidth = 20,
Bandwidth = -1,
IpCount = 100,
IpType = "IPv4",
NormalBandwidth = 100,
Type = "Enterprise",
});
var defaultEipAddress = new AliCloud.Ecs.EipAddress("default", new()
{
AddressName = name,
});
var defaultBgpIp = new AliCloud.Ddos.BgpIp("default", new()
{
InstanceId = instance.Id,
Ip = defaultEipAddress.IpAddress,
ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id)),
MemberUid = current.Apply(getAccountResult => getAccountResult.Id),
});
});
Coming soon!
configuration:
name:
type: string
default: tf-example
resources:
instance:
type: alicloud:ddos:DdosBgpInstance
properties:
name: ${name}
baseBandwidth: 20
bandwidth: -1
ipCount: 100
ipType: IPv4
normalBandwidth: 100
type: Enterprise
defaultEipAddress:
type: alicloud:ecs:EipAddress
name: default
properties:
addressName: ${name}
defaultBgpIp:
type: alicloud:ddos:BgpIp
name: default
properties:
instanceId: ${instance.id}
ip: ${defaultEipAddress.ipAddress}
resourceGroupId: ${default.groups[0].id}
memberUid: ${current.id}
variables:
default:
fn::invoke:
Function: alicloud:resourcemanager:getResourceGroups
Arguments: {}
current:
fn::invoke:
Function: alicloud:getAccount
Arguments: {}
Create BgpIp Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BgpIp(name: string, args: BgpIpArgs, opts?: CustomResourceOptions);
@overload
def BgpIp(resource_name: str,
args: BgpIpArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BgpIp(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
ip: Optional[str] = None,
member_uid: Optional[str] = None,
resource_group_id: Optional[str] = None)
func NewBgpIp(ctx *Context, name string, args BgpIpArgs, opts ...ResourceOption) (*BgpIp, error)
public BgpIp(string name, BgpIpArgs args, CustomResourceOptions? opts = null)
type: alicloud:ddos:BgpIp
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 BgpIpArgs
- 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 BgpIpArgs
- 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 BgpIpArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BgpIpArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BgpIpArgs
- 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 bgpIpResource = new AliCloud.Ddos.BgpIp("bgpIpResource", new()
{
InstanceId = "string",
Ip = "string",
MemberUid = "string",
ResourceGroupId = "string",
});
example, err := ddos.NewBgpIp(ctx, "bgpIpResource", &ddos.BgpIpArgs{
InstanceId: pulumi.String("string"),
Ip: pulumi.String("string"),
MemberUid: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
})
var bgpIpResource = new BgpIp("bgpIpResource", BgpIpArgs.builder()
.instanceId("string")
.ip("string")
.memberUid("string")
.resourceGroupId("string")
.build());
bgp_ip_resource = alicloud.ddos.BgpIp("bgpIpResource",
instance_id="string",
ip="string",
member_uid="string",
resource_group_id="string")
const bgpIpResource = new alicloud.ddos.BgpIp("bgpIpResource", {
instanceId: "string",
ip: "string",
memberUid: "string",
resourceGroupId: "string",
});
type: alicloud:ddos:BgpIp
properties:
instanceId: string
ip: string
memberUid: string
resourceGroupId: string
BgpIp 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 BgpIp resource accepts the following input properties:
- Instance
Id string - The ID of the native protection enterprise instance to be operated.
- Ip string
- The IP address.
- Member
Uid string - The member account id of the IP address.
- Resource
Group stringId - The ID of the resource group.
- Instance
Id string - The ID of the native protection enterprise instance to be operated.
- Ip string
- The IP address.
- Member
Uid string - The member account id of the IP address.
- Resource
Group stringId - The ID of the resource group.
- instance
Id String - The ID of the native protection enterprise instance to be operated.
- ip String
- The IP address.
- member
Uid String - The member account id of the IP address.
- resource
Group StringId - The ID of the resource group.
- instance
Id string - The ID of the native protection enterprise instance to be operated.
- ip string
- The IP address.
- member
Uid string - The member account id of the IP address.
- resource
Group stringId - The ID of the resource group.
- instance_
id str - The ID of the native protection enterprise instance to be operated.
- ip str
- The IP address.
- member_
uid str - The member account id of the IP address.
- resource_
group_ strid - The ID of the resource group.
- instance
Id String - The ID of the native protection enterprise instance to be operated.
- ip String
- The IP address.
- member
Uid String - The member account id of the IP address.
- resource
Group StringId - The ID of the resource group.
Outputs
All input properties are implicitly available as output properties. Additionally, the BgpIp resource produces the following output properties:
Look up Existing BgpIp Resource
Get an existing BgpIp 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?: BgpIpState, opts?: CustomResourceOptions): BgpIp
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
ip: Optional[str] = None,
member_uid: Optional[str] = None,
resource_group_id: Optional[str] = None,
status: Optional[str] = None) -> BgpIp
func GetBgpIp(ctx *Context, name string, id IDInput, state *BgpIpState, opts ...ResourceOption) (*BgpIp, error)
public static BgpIp Get(string name, Input<string> id, BgpIpState? state, CustomResourceOptions? opts = null)
public static BgpIp get(String name, Output<String> id, BgpIpState 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.
- Instance
Id string - The ID of the native protection enterprise instance to be operated.
- Ip string
- The IP address.
- Member
Uid string - The member account id of the IP address.
- Resource
Group stringId - The ID of the resource group.
- Status string
- The current state of the IP address. Valid Value:
normal
,hole_begin
.
- Instance
Id string - The ID of the native protection enterprise instance to be operated.
- Ip string
- The IP address.
- Member
Uid string - The member account id of the IP address.
- Resource
Group stringId - The ID of the resource group.
- Status string
- The current state of the IP address. Valid Value:
normal
,hole_begin
.
- instance
Id String - The ID of the native protection enterprise instance to be operated.
- ip String
- The IP address.
- member
Uid String - The member account id of the IP address.
- resource
Group StringId - The ID of the resource group.
- status String
- The current state of the IP address. Valid Value:
normal
,hole_begin
.
- instance
Id string - The ID of the native protection enterprise instance to be operated.
- ip string
- The IP address.
- member
Uid string - The member account id of the IP address.
- resource
Group stringId - The ID of the resource group.
- status string
- The current state of the IP address. Valid Value:
normal
,hole_begin
.
- instance_
id str - The ID of the native protection enterprise instance to be operated.
- ip str
- The IP address.
- member_
uid str - The member account id of the IP address.
- resource_
group_ strid - The ID of the resource group.
- status str
- The current state of the IP address. Valid Value:
normal
,hole_begin
.
- instance
Id String - The ID of the native protection enterprise instance to be operated.
- ip String
- The IP address.
- member
Uid String - The member account id of the IP address.
- resource
Group StringId - The ID of the resource group.
- status String
- The current state of the IP address. Valid Value:
normal
,hole_begin
.
Import
Ddos Bgp Ip can be imported using the id, e.g.
$ pulumi import alicloud:ddos/bgpIp:BgpIp example <instance_id>:<ip>
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.