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

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/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2.NewEip(ctx, "lb", &ec2.EipArgs{
            Instance: pulumi.String(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,
});

Create a Eip Resource

new Eip(name: string, args?: EipArgs, opts?: CustomResourceOptions);
def Eip(resource_name, opts=None, associate_with_private_ip=None, customer_owned_ipv4_pool=None, instance=None, network_interface=None, public_ipv4_pool=None, tags=None, vpc=None, __props__=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.
opts ResourceOptions
A bag of options that control this 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:

AssociateWithPrivateIp string

A 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

The 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.

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>

A map of tags to assign to the resource.

Vpc bool

Boolean if the EIP is in a VPC or not.

AssociateWithPrivateIp string

A 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

The 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.

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

A map of tags to assign to the resource.

Vpc bool

Boolean if the EIP is in a VPC or not.

associateWithPrivateIp string

A 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

The 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.

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}

A map of tags to assign to the resource.

vpc boolean

Boolean if the EIP is in a VPC or not.

associate_with_private_ip str

A 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

The 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_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 Dict[str, str]

A map of tags to assign to the resource.

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
AssociationId string
CustomerOwnedIp string

Customer owned IP.

Domain string
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
AssociationId string
CustomerOwnedIp string

Customer owned IP.

Domain string
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
associationId string
customerOwnedIp string

Customer owned IP.

domain string
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
association_id str
customer_owned_ip str

Customer owned IP.

domain str
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
static get(resource_name, id, opts=None, allocation_id=None, associate_with_private_ip=None, association_id=None, customer_owned_ip=None, customer_owned_ipv4_pool=None, domain=None, instance=None, network_interface=None, private_dns=None, private_ip=None, public_dns=None, public_ip=None, public_ipv4_pool=None, tags=None, vpc=None, __props__=None);
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:

AllocationId string
AssociateWithPrivateIp string

A 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
CustomerOwnedIp string

Customer owned IP.

CustomerOwnedIpv4Pool string

The ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide

Domain string
Instance string

EC2 instance ID.

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>

A map of tags to assign to the resource.

Vpc bool

Boolean if the EIP is in a VPC or not.

AllocationId string
AssociateWithPrivateIp string

A 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
CustomerOwnedIp string

Customer owned IP.

CustomerOwnedIpv4Pool string

The ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide

Domain string
Instance string

EC2 instance ID.

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

A map of tags to assign to the resource.

Vpc bool

Boolean if the EIP is in a VPC or not.

allocationId string
associateWithPrivateIp string

A 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
customerOwnedIp string

Customer owned IP.

customerOwnedIpv4Pool string

The ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide

domain string
instance string

EC2 instance ID.

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}

A map of tags to assign to the resource.

vpc boolean

Boolean if the EIP is in a VPC or not.

allocation_id str
associate_with_private_ip str

A 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
customer_owned_ip str

Customer owned IP.

customer_owned_ipv4_pool str

The ID of a customer-owned address pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide

domain str
instance str

EC2 instance ID.

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 Dict[str, str]

A map of tags to assign to the resource.

vpc bool

Boolean if the EIP is in a VPC or not.

Package Details

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