Show / Hide Table of Contents

Class EipAssociation

Provides an AWS EIP Association as a top level resource, to associate and disassociate Elastic IPs from AWS Instances and Network Interfaces.

NOTE: Do not use this resource to associate an EIP to aws.lb.LoadBalancer or aws.ec2.NatGateway resources. Instead use the allocation_id available in those resources to allow AWS to manage the association, otherwise you will see AuthFailure errors.

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var web = new Aws.Ec2.Instance("web", new Aws.Ec2.InstanceArgs
    {
        Ami = "ami-21f78e11",
        AvailabilityZone = "us-west-2a",
        InstanceType = "t1.micro",
        Tags = 
        {
            { "Name", "HelloWorld" },
        },
    });
    var example = new Aws.Ec2.Eip("example", new Aws.Ec2.EipArgs
    {
        Vpc = true,
    });
    var eipAssoc = new Aws.Ec2.EipAssociation("eipAssoc", new Aws.Ec2.EipAssociationArgs
    {
        AllocationId = example.Id,
        InstanceId = web.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
EipAssociation
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class EipAssociation : CustomResource

Constructors

View Source

EipAssociation(String, EipAssociationArgs, CustomResourceOptions)

Create a EipAssociation resource with the given unique name, arguments, and options.

Declaration
public EipAssociation(string name, EipAssociationArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

EipAssociationArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AllocationId

The allocation ID. This is required for EC2-VPC.

Declaration
public Output<string> AllocationId { get; }
Property Value
Type Description
Output<System.String>
View Source

AllowReassociation

Whether to allow an Elastic IP to be re-associated. Defaults to true in VPC.

Declaration
public Output<bool?> AllowReassociation { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

InstanceId

The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you can specify either the instance ID or the network interface ID, but not both. The operation fails if you specify an instance ID unless exactly one network interface is attached.

Declaration
public Output<string> InstanceId { get; }
Property Value
Type Description
Output<System.String>
View Source

NetworkInterfaceId

The ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.

Declaration
public Output<string> NetworkInterfaceId { get; }
Property Value
Type Description
Output<System.String>
View Source

PrivateIpAddress

The primary or secondary private IP address to associate with the Elastic IP address. If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.

Declaration
public Output<string> PrivateIpAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

PublicIp

The Elastic IP address. This is required for EC2-Classic.

Declaration
public Output<string> PublicIp { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, EipAssociationState, CustomResourceOptions)

Get an existing EipAssociation resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static EipAssociation Get(string name, Input<string> id, EipAssociationState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

EipAssociationState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
EipAssociation
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.