alicloud logo
Alibaba Cloud v3.37.0, May 15 23

alicloud.ecs.EipAssociation

Explore with Pulumi AI

Provides an Alicloud EIP Association resource for associating Elastic IP to ECS Instance, SLB Instance or Nat Gateway.

NOTE: alicloud.ecs.EipAssociation is useful in scenarios where EIPs are either pre-existing or distributed to customers or users and therefore cannot be changed.

NOTE: From version 1.7.1, the resource support to associate EIP to SLB Instance or Nat Gateway.

NOTE: One EIP can only be associated with ECS or SLB instance which in the VPC.

Module Support

You can use the existing eip module to create several EIP instances and associate them with other resources one-click, like ECS instances, SLB, Nat Gateway and so on.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultZones = AliCloud.GetZones.Invoke();

    var vpc = new AliCloud.Vpc.Network("vpc", new()
    {
        CidrBlock = "10.1.0.0/21",
    });

    var vsw = new AliCloud.Vpc.Switch("vsw", new()
    {
        VpcId = vpc.Id,
        CidrBlock = "10.1.1.0/24",
        ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
    }, new CustomResourceOptions
    {
        DependsOn = new[]
        {
            vpc,
        },
    });

    var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
    {
        AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
    });

    var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
    {
        NameRegex = "^ubuntu_18.*64",
        MostRecent = true,
        Owners = "system",
    });

    var @group = new AliCloud.Ecs.SecurityGroup("group", new()
    {
        Description = "New security group",
        VpcId = vpc.Id,
    });

    var ecsInstance = new AliCloud.Ecs.Instance("ecsInstance", new()
    {
        ImageId = defaultImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
        AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        SecurityGroups = new[]
        {
            @group.Id,
        },
        VswitchId = vsw.Id,
        InstanceName = "hello",
        Tags = 
        {
            { "Name", "TerraformTest-instance" },
        },
    });

    var eip = new AliCloud.Ecs.EipAddress("eip");

    var eipAsso = new AliCloud.Ecs.EipAssociation("eipAsso", new()
    {
        AllocationId = eip.Id,
        InstanceId = ecsInstance.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultZones, err := alicloud.GetZones(ctx, nil, nil)
		if err != nil {
			return err
		}
		vpc, err := vpc.NewNetwork(ctx, "vpc", &vpc.NetworkArgs{
			CidrBlock: pulumi.String("10.1.0.0/21"),
		})
		if err != nil {
			return err
		}
		vsw, err := vpc.NewSwitch(ctx, "vsw", &vpc.SwitchArgs{
			VpcId:     vpc.ID(),
			CidrBlock: pulumi.String("10.1.1.0/24"),
			ZoneId:    *pulumi.String(defaultZones.Zones[0].Id),
		}, pulumi.DependsOn([]pulumi.Resource{
			vpc,
		}))
		if err != nil {
			return err
		}
		defaultInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
			AvailabilityZone: pulumi.StringRef(defaultZones.Zones[0].Id),
		}, nil)
		if err != nil {
			return err
		}
		defaultImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
			NameRegex:  pulumi.StringRef("^ubuntu_18.*64"),
			MostRecent: pulumi.BoolRef(true),
			Owners:     pulumi.StringRef("system"),
		}, nil)
		if err != nil {
			return err
		}
		group, err := ecs.NewSecurityGroup(ctx, "group", &ecs.SecurityGroupArgs{
			Description: pulumi.String("New security group"),
			VpcId:       vpc.ID(),
		})
		if err != nil {
			return err
		}
		ecsInstance, err := ecs.NewInstance(ctx, "ecsInstance", &ecs.InstanceArgs{
			ImageId:          *pulumi.String(defaultImages.Images[0].Id),
			InstanceType:     *pulumi.String(defaultInstanceTypes.InstanceTypes[0].Id),
			AvailabilityZone: *pulumi.String(defaultZones.Zones[0].Id),
			SecurityGroups: pulumi.StringArray{
				group.ID(),
			},
			VswitchId:    vsw.ID(),
			InstanceName: pulumi.String("hello"),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("TerraformTest-instance"),
			},
		})
		if err != nil {
			return err
		}
		eip, err := ecs.NewEipAddress(ctx, "eip", nil)
		if err != nil {
			return err
		}
		_, err = ecs.NewEipAssociation(ctx, "eipAsso", &ecs.EipAssociationArgs{
			AllocationId: eip.ID(),
			InstanceId:   ecsInstance.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.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.ecs.EipAddress;
import com.pulumi.alicloud.ecs.EipAssociation;
import com.pulumi.alicloud.ecs.EipAssociationArgs;
import com.pulumi.resources.CustomResourceOptions;
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 defaultZones = AlicloudFunctions.getZones();

        var vpc = new Network("vpc", NetworkArgs.builder()        
            .cidrBlock("10.1.0.0/21")
            .build());

        var vsw = new Switch("vsw", SwitchArgs.builder()        
            .vpcId(vpc.id())
            .cidrBlock("10.1.1.0/24")
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .build(), CustomResourceOptions.builder()
                .dependsOn(vpc)
                .build());

        final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
            .availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .build());

        final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
            .nameRegex("^ubuntu_18.*64")
            .mostRecent(true)
            .owners("system")
            .build());

        var group = new SecurityGroup("group", SecurityGroupArgs.builder()        
            .description("New security group")
            .vpcId(vpc.id())
            .build());

        var ecsInstance = new Instance("ecsInstance", InstanceArgs.builder()        
            .imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
            .instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
            .availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .securityGroups(group.id())
            .vswitchId(vsw.id())
            .instanceName("hello")
            .tags(Map.of("Name", "TerraformTest-instance"))
            .build());

        var eip = new EipAddress("eip");

        var eipAsso = new EipAssociation("eipAsso", EipAssociationArgs.builder()        
            .allocationId(eip.id())
            .instanceId(ecsInstance.id())
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_zones = alicloud.get_zones()
vpc = alicloud.vpc.Network("vpc", cidr_block="10.1.0.0/21")
vsw = alicloud.vpc.Switch("vsw",
    vpc_id=vpc.id,
    cidr_block="10.1.1.0/24",
    zone_id=default_zones.zones[0].id,
    opts=pulumi.ResourceOptions(depends_on=[vpc]))
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0].id)
default_images = alicloud.ecs.get_images(name_regex="^ubuntu_18.*64",
    most_recent=True,
    owners="system")
group = alicloud.ecs.SecurityGroup("group",
    description="New security group",
    vpc_id=vpc.id)
ecs_instance = alicloud.ecs.Instance("ecsInstance",
    image_id=default_images.images[0].id,
    instance_type=default_instance_types.instance_types[0].id,
    availability_zone=default_zones.zones[0].id,
    security_groups=[group.id],
    vswitch_id=vsw.id,
    instance_name="hello",
    tags={
        "Name": "TerraformTest-instance",
    })
eip = alicloud.ecs.EipAddress("eip")
eip_asso = alicloud.ecs.EipAssociation("eipAsso",
    allocation_id=eip.id,
    instance_id=ecs_instance.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultZones = alicloud.getZones({});
const vpc = new alicloud.vpc.Network("vpc", {cidrBlock: "10.1.0.0/21"});
const vsw = new alicloud.vpc.Switch("vsw", {
    vpcId: vpc.id,
    cidrBlock: "10.1.1.0/24",
    zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
}, {
    dependsOn: [vpc],
});
const defaultInstanceTypes = defaultZones.then(defaultZones => alicloud.ecs.getInstanceTypes({
    availabilityZone: defaultZones.zones?.[0]?.id,
}));
const defaultImages = alicloud.ecs.getImages({
    nameRegex: "^ubuntu_18.*64",
    mostRecent: true,
    owners: "system",
});
const group = new alicloud.ecs.SecurityGroup("group", {
    description: "New security group",
    vpcId: vpc.id,
});
const ecsInstance = new alicloud.ecs.Instance("ecsInstance", {
    imageId: defaultImages.then(defaultImages => defaultImages.images?.[0]?.id),
    instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.instanceTypes?.[0]?.id),
    availabilityZone: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
    securityGroups: [group.id],
    vswitchId: vsw.id,
    instanceName: "hello",
    tags: {
        Name: "TerraformTest-instance",
    },
});
const eip = new alicloud.ecs.EipAddress("eip", {});
const eipAsso = new alicloud.ecs.EipAssociation("eipAsso", {
    allocationId: eip.id,
    instanceId: ecsInstance.id,
});
resources:
  vpc:
    type: alicloud:vpc:Network
    properties:
      cidrBlock: 10.1.0.0/21
  vsw:
    type: alicloud:vpc:Switch
    properties:
      vpcId: ${vpc.id}
      cidrBlock: 10.1.1.0/24
      zoneId: ${defaultZones.zones[0].id}
    options:
      dependson:
        - ${vpc}
  ecsInstance:
    type: alicloud:ecs:Instance
    properties:
      imageId: ${defaultImages.images[0].id}
      instanceType: ${defaultInstanceTypes.instanceTypes[0].id}
      availabilityZone: ${defaultZones.zones[0].id}
      securityGroups:
        - ${group.id}
      vswitchId: ${vsw.id}
      instanceName: hello
      tags:
        Name: TerraformTest-instance
  eip:
    type: alicloud:ecs:EipAddress
  eipAsso:
    type: alicloud:ecs:EipAssociation
    properties:
      allocationId: ${eip.id}
      instanceId: ${ecsInstance.id}
  group:
    type: alicloud:ecs:SecurityGroup
    properties:
      description: New security group
      vpcId: ${vpc.id}
variables:
  defaultZones:
    fn::invoke:
      Function: alicloud:getZones
      Arguments: {}
  defaultInstanceTypes:
    fn::invoke:
      Function: alicloud:ecs:getInstanceTypes
      Arguments:
        availabilityZone: ${defaultZones.zones[0].id}
  defaultImages:
    fn::invoke:
      Function: alicloud:ecs:getImages
      Arguments:
        nameRegex: ^ubuntu_18.*64
        mostRecent: true
        owners: system

Create EipAssociation Resource

new EipAssociation(name: string, args: EipAssociationArgs, opts?: CustomResourceOptions);
@overload
def EipAssociation(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   allocation_id: Optional[str] = None,
                   force: Optional[bool] = None,
                   instance_id: Optional[str] = None,
                   instance_type: Optional[str] = None,
                   private_ip_address: Optional[str] = None,
                   vpc_id: Optional[str] = None)
@overload
def EipAssociation(resource_name: str,
                   args: EipAssociationArgs,
                   opts: Optional[ResourceOptions] = None)
func NewEipAssociation(ctx *Context, name string, args EipAssociationArgs, opts ...ResourceOption) (*EipAssociation, error)
public EipAssociation(string name, EipAssociationArgs args, CustomResourceOptions? opts = null)
public EipAssociation(String name, EipAssociationArgs args)
public EipAssociation(String name, EipAssociationArgs args, CustomResourceOptions options)
type: alicloud:ecs:EipAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EipAssociationArgs
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 EipAssociationArgs
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 EipAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EipAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EipAssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

EipAssociation 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 EipAssociation resource accepts the following input properties:

AllocationId string

The allocation EIP ID.

InstanceId string

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

Force bool

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

InstanceType string

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

PrivateIpAddress string

The private IP address in the network segment of the vswitch which has been assigned.

VpcId string

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

AllocationId string

The allocation EIP ID.

InstanceId string

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

Force bool

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

InstanceType string

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

PrivateIpAddress string

The private IP address in the network segment of the vswitch which has been assigned.

VpcId string

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocationId String

The allocation EIP ID.

instanceId String

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

force Boolean

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instanceType String

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

privateIpAddress String

The private IP address in the network segment of the vswitch which has been assigned.

vpcId String

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocationId string

The allocation EIP ID.

instanceId string

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

force boolean

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instanceType string

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

privateIpAddress string

The private IP address in the network segment of the vswitch which has been assigned.

vpcId string

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocation_id str

The allocation EIP ID.

instance_id str

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

force bool

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instance_type str

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

private_ip_address str

The private IP address in the network segment of the vswitch which has been assigned.

vpc_id str

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocationId String

The allocation EIP ID.

instanceId String

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

force Boolean

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instanceType String

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

privateIpAddress String

The private IP address in the network segment of the vswitch which has been assigned.

vpcId String

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

Outputs

All input properties are implicitly available as output properties. Additionally, the EipAssociation resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing EipAssociation Resource

Get an existing EipAssociation 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?: EipAssociationState, opts?: CustomResourceOptions): EipAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allocation_id: Optional[str] = None,
        force: Optional[bool] = None,
        instance_id: Optional[str] = None,
        instance_type: Optional[str] = None,
        private_ip_address: Optional[str] = None,
        vpc_id: Optional[str] = None) -> EipAssociation
func GetEipAssociation(ctx *Context, name string, id IDInput, state *EipAssociationState, opts ...ResourceOption) (*EipAssociation, error)
public static EipAssociation Get(string name, Input<string> id, EipAssociationState? state, CustomResourceOptions? opts = null)
public static EipAssociation get(String name, Output<String> id, EipAssociationState 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:
AllocationId string

The allocation EIP ID.

Force bool

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

InstanceId string

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

InstanceType string

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

PrivateIpAddress string

The private IP address in the network segment of the vswitch which has been assigned.

VpcId string

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

AllocationId string

The allocation EIP ID.

Force bool

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

InstanceId string

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

InstanceType string

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

PrivateIpAddress string

The private IP address in the network segment of the vswitch which has been assigned.

VpcId string

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocationId String

The allocation EIP ID.

force Boolean

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instanceId String

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

instanceType String

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

privateIpAddress String

The private IP address in the network segment of the vswitch which has been assigned.

vpcId String

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocationId string

The allocation EIP ID.

force boolean

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instanceId string

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

instanceType string

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

privateIpAddress string

The private IP address in the network segment of the vswitch which has been assigned.

vpcId string

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocation_id str

The allocation EIP ID.

force bool

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instance_id str

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

instance_type str

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

private_ip_address str

The private IP address in the network segment of the vswitch which has been assigned.

vpc_id str

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

allocationId String

The allocation EIP ID.

force Boolean

When EIP is bound to a NAT gateway, and the NAT gateway adds a DNAT or SNAT entry, set it for true can unassociation any way. Default to false.

instanceId String

The ID of the ECS or SLB instance or Nat Gateway or NetworkInterface or HaVip.

instanceType String

The type of cloud product that the eip instance to bind. Valid values: EcsInstance, SlbInstance, Nat, NetworkInterface, HaVip and IpAddress.

privateIpAddress String

The private IP address in the network segment of the vswitch which has been assigned.

vpcId String

The ID of the VPC that has IPv4 gateways enabled and that is deployed in the same region as the EIP. When you associate an EIP with an IP address, the system can enable the IP address to access the Internet based on VPC route configurations. Note: This parameter is required if instance_type is set to IpAddress. In this case, the EIP is associated with an IP address.

Import

Elastic IP address association can be imported using the id, e.g.

 $ pulumi import alicloud:ecs/eipAssociation:EipAssociation example eip-abc12345678:i-abc12355

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.