1. Packages
  2. Alicloud Provider
  3. API Docs
  4. ddos
  5. BgpIp
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.ddos.BgpIp

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 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

    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 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),
    });
    
    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()
    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)
    
    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
    		}
    		_default, err := resourcemanager.GetResourceGroups(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:       int(-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),
    		})
    		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 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)),
        });
    
    });
    
    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}
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          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)
    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.
    
    

    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:

    InstanceId string
    The ID of the native protection enterprise instance to be operated.
    Ip string
    The IP address.
    MemberUid string
    The member account id of 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.
    MemberUid string
    The member account id of 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.
    memberUid String
    The member account id of 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.
    memberUid string
    The member account id of 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.
    member_uid str
    The member account id of 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.
    memberUid String
    The member account id of 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,
            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.
    The following state arguments are supported:
    InstanceId string
    The ID of the native protection enterprise instance to be operated.
    Ip string
    The IP address.
    MemberUid string
    The member account id of 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.
    MemberUid string
    The member account id of 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.
    memberUid String
    The member account id of 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.
    memberUid string
    The member account id of 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.
    member_uid str
    The member account id of 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.
    memberUid String
    The member account id of 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>
    

    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.
    alicloud logo
    Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi