Try AWS Native preview for resources not in the classic version.
aws.ec2.Eip
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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 toaws.lb.LoadBalancer
oraws.ec2.NatGateway
resources. Instead use theallocation_id
available in those resources to allow AWS to manage the association, otherwise you will seeAuthFailure
errors.
Example Usage
Single EIP associated with an instance
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var lb = new Aws.Ec2.Eip("lb", new()
{
Instance = aws_instance.Web.Id,
Vpc = true,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Eip;
import com.pulumi.aws.ec2.EipArgs;
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) {
var lb = new Eip("lb", EipArgs.builder()
.instance(aws_instance.web().id())
.vpc(true)
.build());
}
}
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,
});
resources:
lb:
type: aws:ec2:Eip
properties:
instance: ${aws_instance.web.id}
vpc: true
Multiple EIPs associated with a single network interface
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var multi_ip = new Aws.Ec2.NetworkInterface("multi-ip", new()
{
SubnetId = aws_subnet.Main.Id,
PrivateIps = new[]
{
"10.0.0.10",
"10.0.0.11",
},
});
var one = new Aws.Ec2.Eip("one", new()
{
Vpc = true,
NetworkInterface = multi_ip.Id,
AssociateWithPrivateIp = "10.0.0.10",
});
var two = new Aws.Ec2.Eip("two", new()
{
Vpc = true,
NetworkInterface = multi_ip.Id,
AssociateWithPrivateIp = "10.0.0.11",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.NetworkInterface;
import com.pulumi.aws.ec2.NetworkInterfaceArgs;
import com.pulumi.aws.ec2.Eip;
import com.pulumi.aws.ec2.EipArgs;
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) {
var multi_ip = new NetworkInterface("multi-ip", NetworkInterfaceArgs.builder()
.subnetId(aws_subnet.main().id())
.privateIps(
"10.0.0.10",
"10.0.0.11")
.build());
var one = new Eip("one", EipArgs.builder()
.vpc(true)
.networkInterface(multi_ip.id())
.associateWithPrivateIp("10.0.0.10")
.build());
var two = new Eip("two", EipArgs.builder()
.vpc(true)
.networkInterface(multi_ip.id())
.associateWithPrivateIp("10.0.0.11")
.build());
}
}
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",
});
resources:
multi-ip:
type: aws:ec2:NetworkInterface
properties:
subnetId: ${aws_subnet.main.id}
privateIps:
- 10.0.0.10
- 10.0.0.11
one:
type: aws:ec2:Eip
properties:
vpc: true
networkInterface: ${["multi-ip"].id}
associateWithPrivateIp: 10.0.0.10
two:
type: aws:ec2:Eip
properties:
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 System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var @default = new Aws.Ec2.Vpc("default", new()
{
CidrBlock = "10.0.0.0/16",
EnableDnsHostnames = true,
});
var gw = new Aws.Ec2.InternetGateway("gw", new()
{
VpcId = @default.Id,
});
var myTestSubnet = new Aws.Ec2.Subnet("myTestSubnet", new()
{
VpcId = @default.Id,
CidrBlock = "10.0.0.0/24",
MapPublicIpOnLaunch = true,
}, new CustomResourceOptions
{
DependsOn = new[]
{
gw,
},
});
var foo = new Aws.Ec2.Instance("foo", new()
{
Ami = "ami-5189a661",
InstanceType = "t2.micro",
PrivateIp = "10.0.0.12",
SubnetId = myTestSubnet.Id,
});
var bar = new Aws.Ec2.Eip("bar", new()
{
Vpc = true,
Instance = foo.Id,
AssociateWithPrivateIp = "10.0.0.12",
}, new CustomResourceOptions
{
DependsOn = new[]
{
gw,
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/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
}
myTestSubnet, err := ec2.NewSubnet(ctx, "myTestSubnet", &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: myTestSubnet.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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.ec2.InternetGateway;
import com.pulumi.aws.ec2.InternetGatewayArgs;
import com.pulumi.aws.ec2.Subnet;
import com.pulumi.aws.ec2.SubnetArgs;
import com.pulumi.aws.ec2.Instance;
import com.pulumi.aws.ec2.InstanceArgs;
import com.pulumi.aws.ec2.Eip;
import com.pulumi.aws.ec2.EipArgs;
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) {
var default_ = new Vpc("default", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.enableDnsHostnames(true)
.build());
var gw = new InternetGateway("gw", InternetGatewayArgs.builder()
.vpcId(default_.id())
.build());
var myTestSubnet = new Subnet("myTestSubnet", SubnetArgs.builder()
.vpcId(default_.id())
.cidrBlock("10.0.0.0/24")
.mapPublicIpOnLaunch(true)
.build(), CustomResourceOptions.builder()
.dependsOn(gw)
.build());
var foo = new Instance("foo", InstanceArgs.builder()
.ami("ami-5189a661")
.instanceType("t2.micro")
.privateIp("10.0.0.12")
.subnetId(myTestSubnet.id())
.build());
var bar = new Eip("bar", EipArgs.builder()
.vpc(true)
.instance(foo.id())
.associateWithPrivateIp("10.0.0.12")
.build(), CustomResourceOptions.builder()
.dependsOn(gw)
.build());
}
}
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)
my_test_subnet = aws.ec2.Subnet("myTestSubnet",
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=my_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 myTestSubnet = new aws.ec2.Subnet("myTestSubnet", {
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: myTestSubnet.id,
});
const bar = new aws.ec2.Eip("bar", {
vpc: true,
instance: foo.id,
associateWithPrivateIp: "10.0.0.12",
}, {
dependsOn: [gw],
});
resources:
default:
type: aws:ec2:Vpc
properties:
cidrBlock: 10.0.0.0/16
enableDnsHostnames: true
gw:
type: aws:ec2:InternetGateway
properties:
vpcId: ${default.id}
myTestSubnet:
type: aws:ec2:Subnet
properties:
vpcId: ${default.id}
cidrBlock: 10.0.0.0/24
mapPublicIpOnLaunch: true
options:
dependson:
- ${gw}
foo:
type: aws:ec2:Instance
properties:
# us-west-2
ami: ami-5189a661
instanceType: t2.micro
privateIp: 10.0.0.12
subnetId: ${myTestSubnet.id}
bar:
type: aws:ec2:Eip
properties:
vpc: true
instance: ${foo.id}
associateWithPrivateIp: 10.0.0.12
options:
dependson:
- ${gw}
Allocating EIP from the BYOIP pool
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var byoip_ip = new Aws.Ec2.Eip("byoip-ip", new()
{
PublicIpv4Pool = "ipv4pool-ec2-012345",
Vpc = true,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Eip;
import com.pulumi.aws.ec2.EipArgs;
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) {
var byoip_ip = new Eip("byoip-ip", EipArgs.builder()
.publicIpv4Pool("ipv4pool-ec2-012345")
.vpc(true)
.build());
}
}
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,
});
resources:
byoip-ip:
type: aws:ec2:Eip
properties:
publicIpv4Pool: ipv4pool-ec2-012345
vpc: true
Create 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,
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)
type: aws:ec2:Eip
properties: # The arguments to resource properties.
options: # 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.
- 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.
- name String
- The unique name of the resource.
- args EipArgs
- The arguments to resource properties.
- options 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 Architecture and Concepts 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.
- Associate
With stringPrivate Ip 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 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
Border stringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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>
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Vpc bool
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- Address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- Associate
With stringPrivate Ip 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 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
Border stringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Vpc bool
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- address String
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- associate
With StringPrivate Ip 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 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
Border StringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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>
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- vpc Boolean
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- associate
With stringPrivate Ip 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 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
Border stringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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}
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- vpc boolean
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- address str
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- associate_
with_ strprivate_ ip 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 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_ strgroup 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_ strpool EC2 IPv4 address pool identifier or
amazon
. This option is only available for VPC EIPs.- Mapping[str, str]
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- vpc bool
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- address String
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- associate
With StringPrivate Ip 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 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
Border StringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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>
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- vpc Boolean
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
Outputs
All input properties are implicitly available as output properties. Additionally, the Eip resource produces the following output properties:
- Allocation
Id string ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- Association
Id string ID representing the association of the address with an instance in a VPC.
- Carrier
Ip string Carrier IP address.
- Customer
Owned stringIp 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.
- 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.
- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Allocation
Id string ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- Association
Id string ID representing the association of the address with an instance in a VPC.
- Carrier
Ip string Carrier IP address.
- Customer
Owned stringIp 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.
- 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.
- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- allocation
Id String ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- association
Id String ID representing the association of the address with an instance in a VPC.
- carrier
Ip String Carrier IP address.
- customer
Owned StringIp 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.
- 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.
- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- allocation
Id string ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- association
Id string ID representing the association of the address with an instance in a VPC.
- carrier
Ip string Carrier IP address.
- customer
Owned stringIp 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.
- 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.
- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- 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_ strip 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.
- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- allocation
Id String ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- association
Id String ID representing the association of the address with an instance in a VPC.
- carrier
Ip String Carrier IP address.
- customer
Owned StringIp 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.
- 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.
- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up 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)
public static Eip get(String name, Output<String> id, EipState 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.
- Address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- Allocation
Id string ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- Associate
With stringPrivate Ip 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 ID representing the association of the address with an instance in a VPC.
- Carrier
Ip string Carrier IP address.
- Customer
Owned stringIp Customer owned IP.
- Customer
Owned stringIpv4Pool 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.
- Network
Border stringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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>
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Vpc bool
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- Address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- Allocation
Id string ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- Associate
With stringPrivate Ip 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 ID representing the association of the address with an instance in a VPC.
- Carrier
Ip string Carrier IP address.
- Customer
Owned stringIp Customer owned IP.
- Customer
Owned stringIpv4Pool 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.
- Network
Border stringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- map[string]string
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Vpc bool
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- address String
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- allocation
Id String ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- associate
With StringPrivate Ip 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 ID representing the association of the address with an instance in a VPC.
- carrier
Ip String Carrier IP address.
- customer
Owned StringIp Customer owned IP.
- customer
Owned StringIpv4Pool 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.
- network
Border StringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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>
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- vpc Boolean
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- address string
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- allocation
Id string ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- associate
With stringPrivate Ip 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 ID representing the association of the address with an instance in a VPC.
- carrier
Ip string Carrier IP address.
- customer
Owned stringIp Customer owned IP.
- customer
Owned stringIpv4Pool 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.
- network
Border stringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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}
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- vpc boolean
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- 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_ strprivate_ ip 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_ strip Customer owned IP.
- customer_
owned_ stripv4_ pool 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_ strgroup 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_ strpool EC2 IPv4 address pool identifier or
amazon
. This option is only available for VPC EIPs.- Mapping[str, str]
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- vpc bool
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
- address String
IP address from an EC2 BYOIP pool. This option is only available for VPC EIPs.
- allocation
Id String ID that AWS assigns to represent the allocation of the Elastic IP address for use with instances in a VPC.
- associate
With StringPrivate Ip 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 ID representing the association of the address with an instance in a VPC.
- carrier
Ip String Carrier IP address.
- customer
Owned StringIp Customer owned IP.
- customer
Owned StringIpv4Pool 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.
- network
Border StringGroup Location from which the IP address is advertised. Use this parameter to limit the address to this location.
- 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>
Map of tags to assign to the resource. Tags can only be applied to EIPs in a VPC. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String>
A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- vpc Boolean
Boolean if the EIP is in a VPC or not. Defaults to
true
unless the region supports EC2-Classic.
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
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.