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 in v1.180.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var defaultResourceGroups = AliCloud.ResourceManager.GetResourceGroups.Invoke();
var defaultEipAddress = new AliCloud.Ecs.EipAddress("defaultEipAddress", new()
{
AddressName = @var.Name,
});
var defaultDdosBgpInstances = AliCloud.Ddos.GetDdosBgpInstances.Invoke();
var defaultBgpIp = new AliCloud.Ddos.BgpIp("defaultBgpIp", new()
{
InstanceId = defaultDdosBgpInstances.Apply(getDdosBgpInstancesResult => getDdosBgpInstancesResult.Ids[0]),
Ip = defaultEipAddress.IpAddress,
ResourceGroupId = defaultResourceGroups.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id),
});
});
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-alicloud/sdk/v3/go/alicloud/resourcemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultResourceGroups, err := resourcemanager.GetResourceGroups(ctx, nil, nil)
if err != nil {
return err
}
defaultEipAddress, err := ecs.NewEipAddress(ctx, "defaultEipAddress", &ecs.EipAddressArgs{
AddressName: pulumi.Any(_var.Name),
})
if err != nil {
return err
}
defaultDdosBgpInstances, err := ddos.GetDdosBgpInstances(ctx, nil, nil)
if err != nil {
return err
}
_, err = ddos.NewBgpIp(ctx, "defaultBgpIp", &ddos.BgpIpArgs{
InstanceId: *pulumi.String(defaultDdosBgpInstances.Ids[0]),
Ip: defaultEipAddress.IpAddress,
ResourceGroupId: *pulumi.String(defaultResourceGroups.Groups[0].Id),
})
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.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
import com.pulumi.alicloud.ecs.EipAddress;
import com.pulumi.alicloud.ecs.EipAddressArgs;
import com.pulumi.alicloud.ddos.DdosFunctions;
import com.pulumi.alicloud.ddos.inputs.GetDdosBgpInstancesArgs;
import com.pulumi.alicloud.ddos.BgpIp;
import com.pulumi.alicloud.ddos.BgpIpArgs;
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 defaultResourceGroups = ResourcemanagerFunctions.getResourceGroups();
var defaultEipAddress = new EipAddress("defaultEipAddress", EipAddressArgs.builder()
.addressName(var_.name())
.build());
final var defaultDdosBgpInstances = DdosFunctions.getDdosBgpInstances();
var defaultBgpIp = new BgpIp("defaultBgpIp", BgpIpArgs.builder()
.instanceId(defaultDdosBgpInstances.applyValue(getDdosBgpInstancesResult -> getDdosBgpInstancesResult.ids()[0]))
.ip(defaultEipAddress.ipAddress())
.resourceGroupId(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.groups()[0].id()))
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
default_resource_groups = alicloud.resourcemanager.get_resource_groups()
default_eip_address = alicloud.ecs.EipAddress("defaultEipAddress", address_name=var["name"])
default_ddos_bgp_instances = alicloud.ddos.get_ddos_bgp_instances()
default_bgp_ip = alicloud.ddos.BgpIp("defaultBgpIp",
instance_id=default_ddos_bgp_instances.ids[0],
ip=default_eip_address.ip_address,
resource_group_id=default_resource_groups.groups[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const defaultResourceGroups = alicloud.resourcemanager.getResourceGroups({});
const defaultEipAddress = new alicloud.ecs.EipAddress("defaultEipAddress", {addressName: _var.name});
const defaultDdosBgpInstances = alicloud.ddos.getDdosBgpInstances({});
const defaultBgpIp = new alicloud.ddos.BgpIp("defaultBgpIp", {
instanceId: defaultDdosBgpInstances.then(defaultDdosBgpInstances => defaultDdosBgpInstances.ids?.[0]),
ip: defaultEipAddress.ipAddress,
resourceGroupId: defaultResourceGroups.then(defaultResourceGroups => defaultResourceGroups.groups?.[0]?.id),
});
resources:
defaultEipAddress:
type: alicloud:ecs:EipAddress
properties:
addressName: ${var.name}
defaultBgpIp:
type: alicloud:ddos:BgpIp
properties:
instanceId: ${defaultDdosBgpInstances.ids[0]}
ip: ${defaultEipAddress.ipAddress}
resourceGroupId: ${defaultResourceGroups.groups[0].id}
variables:
defaultResourceGroups:
fn::invoke:
Function: alicloud:resourcemanager:getResourceGroups
Arguments: {}
defaultDdosBgpInstances:
fn::invoke:
Function: alicloud:ddos:getDdosBgpInstances
Arguments: {}
Create BgpIp Resource
new BgpIp(name: string, args: BgpIpArgs, opts?: CustomResourceOptions);
@overload
def BgpIp(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
ip: Optional[str] = None,
resource_group_id: Optional[str] = None)
@overload
def BgpIp(resource_name: str,
args: BgpIpArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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,
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.