Eip

Provides an Elastic IP resource.

Note: EIP may require IGW to exist prior to association. Use depends_on to set an explicit dependency on the IGW.

Note: Do not use network_interface to associate the 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.

Example Usage

Single EIP associated with an instance

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var lb = new Aws.Ec2.Eip("lb", new Aws.Ec2.EipArgs
        {
            Instance = aws_instance.Web.Id,
            Vpc = true,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewEip(ctx, "lb", &ec2.EipArgs{
			Instance: pulumi.Any(aws_instance.Web.Id),
			Vpc:      pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

lb = aws.ec2.Eip("lb",
    instance=aws_instance["web"]["id"],
    vpc=True)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const lb = new aws.ec2.Eip("lb", {
    instance: aws_instance.web.id,
    vpc: true,
});

Multiple EIPs associated with a single network interface

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var multi_ip = new Aws.Ec2.NetworkInterface("multi-ip", new Aws.Ec2.NetworkInterfaceArgs
        {
            SubnetId = aws_subnet.Main.Id,
            PrivateIps = 
            {
                "10.0.0.10",
                "10.0.0.11",
            },
        });
        var one = new Aws.Ec2.Eip("one", new Aws.Ec2.EipArgs
        {
            Vpc = true,
            NetworkInterface = multi_ip.Id,
            AssociateWithPrivateIp = "10.0.0.10",
        });
        var two = new Aws.Ec2.Eip("two", new Aws.Ec2.EipArgs
        {
            Vpc = true,
            NetworkInterface = multi_ip.Id,
            AssociateWithPrivateIp = "10.0.0.11",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewNetworkInterface(ctx, "multi_ip", &ec2.NetworkInterfaceArgs{
			SubnetId: pulumi.Any(aws_subnet.Main.Id),
			PrivateIps: pulumi.StringArray{
				pulumi.String("10.0.0.10"),
				pulumi.String("10.0.0.11"),
			},
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewEip(ctx, "one", &ec2.EipArgs{
			Vpc:                    pulumi.Bool(true),
			NetworkInterface:       multi_ip.ID(),
			AssociateWithPrivateIp: pulumi.String("10.0.0.10"),
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewEip(ctx, "two", &ec2.EipArgs{
			Vpc:                    pulumi.Bool(true),
			NetworkInterface:       multi_ip.ID(),
			AssociateWithPrivateIp: pulumi.String("10.0.0.11"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

multi_ip = aws.ec2.NetworkInterface("multi-ip",
    subnet_id=aws_subnet["main"]["id"],
    private_ips=[
        "10.0.0.10",
        "10.0.0.11",
    ])
one = aws.ec2.Eip("one",
    vpc=True,
    network_interface=multi_ip.id,
    associate_with_private_ip="10.0.0.10")
two = aws.ec2.Eip("two",
    vpc=True,
    network_interface=multi_ip.id,
    associate_with_private_ip="10.0.0.11")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const multi_ip = new aws.ec2.NetworkInterface("multi-ip", {
    subnetId: aws_subnet.main.id,
    privateIps: [
        "10.0.0.10",
        "10.0.0.11",
    ],
});
const one = new aws.ec2.Eip("one", {
    vpc: true,
    networkInterface: multi_ip.id,
    associateWithPrivateIp: "10.0.0.10",
});
const two = new aws.ec2.Eip("two", {
    vpc: true,
    networkInterface: multi_ip.id,
    associateWithPrivateIp: "10.0.0.11",
});

Attaching an EIP to an Instance with a pre-assigned private ip (VPC Only)

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = new Aws.Ec2.Vpc("default", new Aws.Ec2.VpcArgs
        {
            CidrBlock = "10.0.0.0/16",
            EnableDnsHostnames = true,
        });
        var gw = new Aws.Ec2.InternetGateway("gw", new Aws.Ec2.InternetGatewayArgs
        {
            VpcId = @default.Id,
        });
        var tfTestSubnet = new Aws.Ec2.Subnet("tfTestSubnet", new Aws.Ec2.SubnetArgs
        {
            VpcId = @default.Id,
            CidrBlock = "10.0.0.0/24",
            MapPublicIpOnLaunch = true,
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                gw,
            },
        });
        var foo = new Aws.Ec2.Instance("foo", new Aws.Ec2.InstanceArgs
        {
            Ami = "ami-5189a661",
            InstanceType = "t2.micro",
            PrivateIp = "10.0.0.12",
            SubnetId = tfTestSubnet.Id,
        });
        var bar = new Aws.Ec2.Eip("bar", new Aws.Ec2.EipArgs
        {
            Vpc = true,
            Instance = foo.Id,
            AssociateWithPrivateIp = "10.0.0.12",
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                gw,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewVpc(ctx, "_default", &ec2.VpcArgs{
			CidrBlock:          pulumi.String("10.0.0.0/16"),
			EnableDnsHostnames: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		gw, err := ec2.NewInternetGateway(ctx, "gw", &ec2.InternetGatewayArgs{
			VpcId: _default.ID(),
		})
		if err != nil {
			return err
		}
		tfTestSubnet, err := ec2.NewSubnet(ctx, "tfTestSubnet", &ec2.SubnetArgs{
			VpcId:               _default.ID(),
			CidrBlock:           pulumi.String("10.0.0.0/24"),
			MapPublicIpOnLaunch: pulumi.Bool(true),
		}, pulumi.DependsOn([]pulumi.Resource{
			gw,
		}))
		if err != nil {
			return err
		}
		foo, err := ec2.NewInstance(ctx, "foo", &ec2.InstanceArgs{
			Ami:          pulumi.String("ami-5189a661"),
			InstanceType: pulumi.String("t2.micro"),
			PrivateIp:    pulumi.String("10.0.0.12"),
			SubnetId:     tfTestSubnet.ID(),
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewEip(ctx, "bar", &ec2.EipArgs{
			Vpc:                    pulumi.Bool(true),
			Instance:               foo.ID(),
			AssociateWithPrivateIp: pulumi.String("10.0.0.12"),
		}, pulumi.DependsOn([]pulumi.Resource{
			gw,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

default = aws.ec2.Vpc("default",
    cidr_block="10.0.0.0/16",
    enable_dns_hostnames=True)
gw = aws.ec2.InternetGateway("gw", vpc_id=default.id)
tf_test_subnet = aws.ec2.Subnet("tfTestSubnet",
    vpc_id=default.id,
    cidr_block="10.0.0.0/24",
    map_public_ip_on_launch=True,
    opts=pulumi.ResourceOptions(depends_on=[gw]))
foo = aws.ec2.Instance("foo",
    ami="ami-5189a661",
    instance_type="t2.micro",
    private_ip="10.0.0.12",
    subnet_id=tf_test_subnet.id)
bar = aws.ec2.Eip("bar",
    vpc=True,
    instance=foo.id,
    associate_with_private_ip="10.0.0.12",
    opts=pulumi.ResourceOptions(depends_on=[gw]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const _default = new aws.ec2.Vpc("default", {
    cidrBlock: "10.0.0.0/16",
    enableDnsHostnames: true,
});
const gw = new aws.ec2.InternetGateway("gw", {vpcId: _default.id});
const tfTestSubnet = new aws.ec2.Subnet("tfTestSubnet", {
    vpcId: _default.id,
    cidrBlock: "10.0.0.0/24",
    mapPublicIpOnLaunch: true,
}, {
    dependsOn: [gw],
});
const foo = new aws.ec2.Instance("foo", {
    ami: "ami-5189a661",
    instanceType: "t2.micro",
    privateIp: "10.0.0.12",
    subnetId: tfTestSubnet.id,
});
const bar = new aws.ec2.Eip("bar", {
    vpc: true,
    instance: foo.id,
    associateWithPrivateIp: "10.0.0.12",
}, {
    dependsOn: [gw],
});

Allocating EIP from the BYOIP pool

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var byoip_ip = new Aws.Ec2.Eip("byoip-ip", new Aws.Ec2.EipArgs
        {
            PublicIpv4Pool = "ipv4pool-ec2-012345",
            Vpc = true,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewEip(ctx, "byoip_ip", &ec2.EipArgs{
			PublicIpv4Pool: pulumi.String("ipv4pool-ec2-012345"),
			Vpc:            pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

byoip_ip = aws.ec2.Eip("byoip-ip",
    public_ipv4_pool="ipv4pool-ec2-012345",
    vpc=True)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const byoip_ip = new aws.ec2.Eip("byoip-ip", {
    publicIpv4Pool: "ipv4pool-ec2-012345",
    vpc: true,
});

Create a Eip Resource

new Eip(name: string, args?: EipArgs, opts?: CustomResourceOptions);
@overload
def Eip(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        address: Optional[str] = None,
        associate_with_private_ip: Optional[str] = None,
        customer_owned_ipv4_pool: Optional[str] = None,
        instance: Optional[str] = None,
        network_border_group: Optional[str] = None,
        network_interface: Optional[str] = None,
        public_ipv4_pool: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        vpc: Optional[bool] = None)
@overload
def Eip(resource_name: str,
        args: Optional[EipArgs] = None,
        opts: Optional[ResourceOptions] = None)
func NewEip(ctx *Context, name string, args *EipArgs, opts ...ResourceOption) (*Eip, error)
public Eip(string name, EipArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args EipArgs
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 EipArgs
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 EipArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EipArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Eip Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Eip resource accepts the following input properties:

Address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
AssociateWithPrivateIp string
User-specified 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.
CustomerOwnedIpv4Pool string
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
Instance string
EC2 instance ID.
NetworkBorderGroup string
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
NetworkInterface string
Network interface ID to associate with.
PublicIpv4Pool string
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
Tags Dictionary<string, string>
TagsAll Dictionary<string, string>
Vpc bool
Boolean if the EIP is in a VPC or not.
Address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
AssociateWithPrivateIp string
User-specified 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.
CustomerOwnedIpv4Pool string
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
Instance string
EC2 instance ID.
NetworkBorderGroup string
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
NetworkInterface string
Network interface ID to associate with.
PublicIpv4Pool string
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
Tags map[string]string
TagsAll map[string]string
Vpc bool
Boolean if the EIP is in a VPC or not.
address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
associateWithPrivateIp string
User-specified 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.
customerOwnedIpv4Pool string
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
instance string
EC2 instance ID.
networkBorderGroup string
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
networkInterface string
Network interface ID to associate with.
publicIpv4Pool string
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
tags {[key: string]: string}
tagsAll {[key: string]: string}
vpc boolean
Boolean if the EIP is in a VPC or not.
address str
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
associate_with_private_ip str
User-specified 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.
customer_owned_ipv4_pool str
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
instance str
EC2 instance ID.
network_border_group str
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
network_interface str
Network interface ID to associate with.
public_ipv4_pool str
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
tags Mapping[str, str]
tags_all Mapping[str, str]
vpc bool
Boolean if the EIP is in a VPC or not.

Outputs

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

AllocationId string
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
AssociationId string
ID representing the association of the address with an instance in a VPC.
CarrierIp string
Carrier IP address.
CustomerOwnedIp string
Customer owned IP.
Domain string
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
Id string
The provider-assigned unique ID for this managed resource.
PrivateDns string
The Private DNS associated with the Elastic IP address (if in VPC).
PrivateIp string
Contains the private IP address (if in VPC).
PublicDns string
Public DNS associated with the Elastic IP address.
PublicIp string
Contains the public IP address.
AllocationId string
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
AssociationId string
ID representing the association of the address with an instance in a VPC.
CarrierIp string
Carrier IP address.
CustomerOwnedIp string
Customer owned IP.
Domain string
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
Id string
The provider-assigned unique ID for this managed resource.
PrivateDns string
The Private DNS associated with the Elastic IP address (if in VPC).
PrivateIp string
Contains the private IP address (if in VPC).
PublicDns string
Public DNS associated with the Elastic IP address.
PublicIp string
Contains the public IP address.
allocationId string
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
associationId string
ID representing the association of the address with an instance in a VPC.
carrierIp string
Carrier IP address.
customerOwnedIp string
Customer owned IP.
domain string
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
id string
The provider-assigned unique ID for this managed resource.
privateDns string
The Private DNS associated with the Elastic IP address (if in VPC).
privateIp string
Contains the private IP address (if in VPC).
publicDns string
Public DNS associated with the Elastic IP address.
publicIp string
Contains the public IP address.
allocation_id str
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
association_id str
ID representing the association of the address with an instance in a VPC.
carrier_ip str
Carrier IP address.
customer_owned_ip str
Customer owned IP.
domain str
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
id str
The provider-assigned unique ID for this managed resource.
private_dns str
The Private DNS associated with the Elastic IP address (if in VPC).
private_ip str
Contains the private IP address (if in VPC).
public_dns str
Public DNS associated with the Elastic IP address.
public_ip str
Contains the public IP address.

Look up an Existing Eip Resource

Get an existing Eip 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?: EipState, opts?: CustomResourceOptions): Eip
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        address: Optional[str] = None,
        allocation_id: Optional[str] = None,
        associate_with_private_ip: Optional[str] = None,
        association_id: Optional[str] = None,
        carrier_ip: Optional[str] = None,
        customer_owned_ip: Optional[str] = None,
        customer_owned_ipv4_pool: Optional[str] = None,
        domain: Optional[str] = None,
        instance: Optional[str] = None,
        network_border_group: Optional[str] = None,
        network_interface: Optional[str] = None,
        private_dns: Optional[str] = None,
        private_ip: Optional[str] = None,
        public_dns: Optional[str] = None,
        public_ip: Optional[str] = None,
        public_ipv4_pool: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        vpc: Optional[bool] = None) -> Eip
func GetEip(ctx *Context, name string, id IDInput, state *EipState, opts ...ResourceOption) (*Eip, error)
public static Eip Get(string name, Input<string> id, EipState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
AllocationId string
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
AssociateWithPrivateIp string
User-specified 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.
AssociationId string
ID representing the association of the address with an instance in a VPC.
CarrierIp string
Carrier IP address.
CustomerOwnedIp string
Customer owned IP.
CustomerOwnedIpv4Pool string
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
Domain string
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
Instance string
EC2 instance ID.
NetworkBorderGroup string
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
NetworkInterface string
Network interface ID to associate with.
PrivateDns string
The Private DNS associated with the Elastic IP address (if in VPC).
PrivateIp string
Contains the private IP address (if in VPC).
PublicDns string
Public DNS associated with the Elastic IP address.
PublicIp string
Contains the public IP address.
PublicIpv4Pool string
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
Tags Dictionary<string, string>
TagsAll Dictionary<string, string>
Vpc bool
Boolean if the EIP is in a VPC or not.
Address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
AllocationId string
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
AssociateWithPrivateIp string
User-specified 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.
AssociationId string
ID representing the association of the address with an instance in a VPC.
CarrierIp string
Carrier IP address.
CustomerOwnedIp string
Customer owned IP.
CustomerOwnedIpv4Pool string
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
Domain string
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
Instance string
EC2 instance ID.
NetworkBorderGroup string
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
NetworkInterface string
Network interface ID to associate with.
PrivateDns string
The Private DNS associated with the Elastic IP address (if in VPC).
PrivateIp string
Contains the private IP address (if in VPC).
PublicDns string
Public DNS associated with the Elastic IP address.
PublicIp string
Contains the public IP address.
PublicIpv4Pool string
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
Tags map[string]string
TagsAll map[string]string
Vpc bool
Boolean if the EIP is in a VPC or not.
address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
allocationId string
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
associateWithPrivateIp string
User-specified 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.
associationId string
ID representing the association of the address with an instance in a VPC.
carrierIp string
Carrier IP address.
customerOwnedIp string
Customer owned IP.
customerOwnedIpv4Pool string
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
domain string
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
instance string
EC2 instance ID.
networkBorderGroup string
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
networkInterface string
Network interface ID to associate with.
privateDns string
The Private DNS associated with the Elastic IP address (if in VPC).
privateIp string
Contains the private IP address (if in VPC).
publicDns string
Public DNS associated with the Elastic IP address.
publicIp string
Contains the public IP address.
publicIpv4Pool string
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
tags {[key: string]: string}
tagsAll {[key: string]: string}
vpc boolean
Boolean if the EIP is in a VPC or not.
address str
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
allocation_id str
ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
associate_with_private_ip str
User-specified 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.
association_id str
ID representing the association of the address with an instance in a VPC.
carrier_ip str
Carrier IP address.
customer_owned_ip str
Customer owned IP.
customer_owned_ipv4_pool str
ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide.
domain str
Indicates if this EIP is for use in VPC (vpc) or EC2 Classic (standard).
instance str
EC2 instance ID.
network_border_group str
Location from which the IP address is advertised. Use this parameter to limit the address to this location.
network_interface str
Network interface ID to associate with.
private_dns str
The Private DNS associated with the Elastic IP address (if in VPC).
private_ip str
Contains the private IP address (if in VPC).
public_dns str
Public DNS associated with the Elastic IP address.
public_ip str
Contains the public IP address.
public_ipv4_pool str
EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs.
tags Mapping[str, str]
tags_all Mapping[str, str]
vpc bool
Boolean if the EIP is in a VPC or not.

Import

EIPs in a VPC can be imported using their Allocation ID, e.g.

 $ pulumi import aws:ec2/eip:Eip bar eipalloc-00a10e96

EIPs in EC2 Classic can be imported using their Public IP, e.g.

 $ pulumi import aws:ec2/eip:Eip bar 52.0.0.0

[1]https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AssociateAddress.html

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.