Eip
Provides an Elastic IP resource.
Note: EIP may require IGW to exist prior to association. Use
depends_onto set an explicit dependency on the IGW.Note: Do not use
network_interfaceto associate the EIP toaws.lb.LoadBalanceroraws.ec2.NatGatewayresources. Instead use theallocation_idavailable in those resources to allow AWS to manage the association, otherwise you will seeAuthFailureerrors.
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);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:
- Associate
With stringPrivate Ip 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 stringIpv4Pool 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.
- Network
Interface string Network interface ID to associate with.
- Public
Ipv4Pool string EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- Dictionary<string, string>
A map of tags to assign to the resource.
- Vpc bool
Boolean if the EIP is in a VPC or not.
- Associate
With stringPrivate Ip 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 stringIpv4Pool 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.
- Network
Interface string Network interface ID to associate with.
- Public
Ipv4Pool string EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- map[string]string
A map of tags to assign to the resource.
- Vpc bool
Boolean if the EIP is in a VPC or not.
- associate
With stringPrivate Ip 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 stringIpv4Pool 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.
- network
Interface string Network interface ID to associate with.
- public
Ipv4Pool string EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- {[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_ strprivate_ ip 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_ stripv4_ pool 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_ strpool EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- 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:
- Allocation
Id string - Association
Id string - Customer
Owned stringIp Customer owned IP.
- Domain string
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Dns string The Private DNS associated with the Elastic IP address (if in VPC).
- Private
Ip string Contains the private IP address (if in VPC).
- Public
Dns string Public DNS associated with the Elastic IP address.
- Public
Ip string Contains the public IP address.
- Allocation
Id string - Association
Id string - Customer
Owned stringIp Customer owned IP.
- Domain string
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Dns string The Private DNS associated with the Elastic IP address (if in VPC).
- Private
Ip string Contains the private IP address (if in VPC).
- Public
Dns string Public DNS associated with the Elastic IP address.
- Public
Ip string Contains the public IP address.
- allocation
Id string - association
Id string - customer
Owned stringIp Customer owned IP.
- domain string
- id string
- The provider-assigned unique ID for this managed resource.
- private
Dns string The Private DNS associated with the Elastic IP address (if in VPC).
- private
Ip string Contains the private IP address (if in VPC).
- public
Dns string Public DNS associated with the Elastic IP address.
- public
Ip string Contains the public IP address.
- allocation_
id str - association_
id str - customer_
owned_ strip 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): Eipstatic 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);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:
- Allocation
Id string - Associate
With stringPrivate Ip 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 string - Customer
Owned stringIp Customer owned IP.
- Customer
Owned stringIpv4Pool 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.
- Network
Interface string Network interface ID to associate with.
- Private
Dns string The Private DNS associated with the Elastic IP address (if in VPC).
- Private
Ip string Contains the private IP address (if in VPC).
- Public
Dns string Public DNS associated with the Elastic IP address.
- Public
Ip string Contains the public IP address.
- Public
Ipv4Pool string EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- Dictionary<string, string>
A map of tags to assign to the resource.
- Vpc bool
Boolean if the EIP is in a VPC or not.
- Allocation
Id string - Associate
With stringPrivate Ip 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 string - Customer
Owned stringIp Customer owned IP.
- Customer
Owned stringIpv4Pool 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.
- Network
Interface string Network interface ID to associate with.
- Private
Dns string The Private DNS associated with the Elastic IP address (if in VPC).
- Private
Ip string Contains the private IP address (if in VPC).
- Public
Dns string Public DNS associated with the Elastic IP address.
- Public
Ip string Contains the public IP address.
- Public
Ipv4Pool string EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- map[string]string
A map of tags to assign to the resource.
- Vpc bool
Boolean if the EIP is in a VPC or not.
- allocation
Id string - associate
With stringPrivate Ip 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 string - customer
Owned stringIp Customer owned IP.
- customer
Owned stringIpv4Pool 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.
- network
Interface string Network interface ID to associate with.
- private
Dns string The Private DNS associated with the Elastic IP address (if in VPC).
- private
Ip string Contains the private IP address (if in VPC).
- public
Dns string Public DNS associated with the Elastic IP address.
- public
Ip string Contains the public IP address.
- public
Ipv4Pool string EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- {[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_ strprivate_ ip 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_ strip Customer owned IP.
- customer_
owned_ stripv4_ pool 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_ strpool EC2 IPv4 address pool identifier or
amazon. This option is only available for VPC EIPs.- 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
awsTerraform Provider.