1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ddos
  5. BgpIp
Alibaba Cloud v3.49.1 published on Wednesday, Feb 28, 2024 by Pulumi

alicloud.ddos.BgpIp

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.49.1 published on Wednesday, Feb 28, 2024 by Pulumi

    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

    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 defaultResourceGroups = AliCloud.ResourceManager.GetResourceGroups.Invoke();
    
        var instance = new AliCloud.Ddos.DdosBgpInstance("instance", new()
        {
            BaseBandwidth = 20,
            Bandwidth = -1,
            IpCount = 100,
            IpType = "IPv4",
            NormalBandwidth = 100,
            Type = "Enterprise",
        });
    
        var defaultEipAddress = new AliCloud.Ecs.EipAddress("defaultEipAddress", new()
        {
            AddressName = name,
        });
    
        var defaultBgpIp = new AliCloud.Ddos.BgpIp("defaultBgpIp", new()
        {
            InstanceId = instance.Id,
            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"
    	"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
    		}
    		defaultResourceGroups, err := resourcemanager.GetResourceGroups(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		instance, err := ddos.NewDdosBgpInstance(ctx, "instance", &ddos.DdosBgpInstanceArgs{
    			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, "defaultEipAddress", &ecs.EipAddressArgs{
    			AddressName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ddos.NewBgpIp(ctx, "defaultBgpIp", &ddos.BgpIpArgs{
    			InstanceId:      instance.ID(),
    			Ip:              defaultEipAddress.IpAddress,
    			ResourceGroupId: *pulumi.String(defaultResourceGroups.Groups[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_resource_groups = alicloud.resourcemanager.get_resource_groups()
    instance = alicloud.ddos.DdosBgpInstance("instance",
        base_bandwidth=20,
        bandwidth=-1,
        ip_count=100,
        ip_type="IPv4",
        normal_bandwidth=100,
        type="Enterprise")
    default_eip_address = alicloud.ecs.EipAddress("defaultEipAddress", address_name=name)
    default_bgp_ip = alicloud.ddos.BgpIp("defaultBgpIp",
        instance_id=instance.id,
        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 config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const defaultResourceGroups = alicloud.resourcemanager.getResourceGroups({});
    const instance = new alicloud.ddos.DdosBgpInstance("instance", {
        baseBandwidth: 20,
        bandwidth: -1,
        ipCount: 100,
        ipType: "IPv4",
        normalBandwidth: 100,
        type: "Enterprise",
    });
    const defaultEipAddress = new alicloud.ecs.EipAddress("defaultEipAddress", {addressName: name});
    const defaultBgpIp = new alicloud.ddos.BgpIp("defaultBgpIp", {
        instanceId: instance.id,
        ip: defaultEipAddress.ipAddress,
        resourceGroupId: defaultResourceGroups.then(defaultResourceGroups => defaultResourceGroups.groups?.[0]?.id),
    });
    

    Coming soon!

    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)
    public BgpIp(String name, BgpIpArgs args)
    public BgpIp(String name, BgpIpArgs args, CustomResourceOptions options)
    
    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:

    InstanceId string
    The ID of the native protection enterprise instance to be operated.
    Ip string
    The IP address.
    ResourceGroupId string
    The ID of the resource group.
    InstanceId string
    The ID of the native protection enterprise instance to be operated.
    Ip string
    The IP address.
    ResourceGroupId string
    The ID of the resource group.
    instanceId String
    The ID of the native protection enterprise instance to be operated.
    ip String
    The IP address.
    resourceGroupId String
    The ID of the resource group.
    instanceId string
    The ID of the native protection enterprise instance to be operated.
    ip string
    The IP address.
    resourceGroupId string
    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_id str
    The ID of the resource group.
    instanceId String
    The ID of the native protection enterprise instance to be operated.
    ip String
    The IP address.
    resourceGroupId String
    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:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The current state of the IP address. Valid Value: normal, hole_begin.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The current state of the IP address. Valid Value: normal, hole_begin.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The current state of the IP address. Valid Value: normal, hole_begin.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The current state of the IP address. Valid Value: normal, hole_begin.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The current state of the IP address. Valid Value: normal, hole_begin.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The current state of the IP address. Valid Value: normal, hole_begin.

    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.
    The following state arguments are supported:
    InstanceId string
    The ID of the native protection enterprise instance to be operated.
    Ip string
    The IP address.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The current state of the IP address. Valid Value: normal, hole_begin.
    InstanceId string
    The ID of the native protection enterprise instance to be operated.
    Ip string
    The IP address.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The current state of the IP address. Valid Value: normal, hole_begin.
    instanceId String
    The ID of the native protection enterprise instance to be operated.
    ip String
    The IP address.
    resourceGroupId String
    The ID of the resource group.
    status String
    The current state of the IP address. Valid Value: normal, hole_begin.
    instanceId string
    The ID of the native protection enterprise instance to be operated.
    ip string
    The IP address.
    resourceGroupId string
    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_id str
    The ID of the resource group.
    status str
    The current state of the IP address. Valid Value: normal, hole_begin.
    instanceId String
    The ID of the native protection enterprise instance to be operated.
    ip String
    The IP address.
    resourceGroupId String
    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.
    alicloud logo
    Alibaba Cloud v3.49.1 published on Wednesday, Feb 28, 2024 by Pulumi