getElasticIp
Deprecated: aws.getElasticIp has been deprecated in favor of aws.ec2.getElasticIp
aws.ec2.Eip
provides details about a specific Elastic IP.
Example Usage
Search By Allocation ID (VPC only)
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var byAllocationId = Output.Create(Aws.Ec2.GetElasticIp.InvokeAsync(new Aws.Ec2.GetElasticIpArgs
{
Id = "eipalloc-12345678",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := "eipalloc-12345678"
_, err := ec2.GetElasticIp(ctx, &ec2.GetElasticIpArgs{
Id: &opt0,
}, nil)
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_aws as aws
by_allocation_id = aws.ec2.get_elastic_ip(id="eipalloc-12345678")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const byAllocationId = pulumi.output(aws.ec2.getElasticIp({
id: "eipalloc-12345678",
}, { async: true }));
Search By Filters (EC2-Classic or VPC)
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var byFilter = Output.Create(Aws.Ec2.GetElasticIp.InvokeAsync(new Aws.Ec2.GetElasticIpArgs
{
Filters =
{
new Aws.Ec2.Inputs.GetElasticIpFilterArgs
{
Name = "tag:Name",
Values =
{
"exampleNameTagValue",
},
},
},
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.GetElasticIp(ctx, &ec2.GetElasticIpArgs{
Filters: []ec2.GetElasticIpFilter{
ec2.GetElasticIpFilter{
Name: "tag:Name",
Values: []string{
"exampleNameTagValue",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_aws as aws
by_filter = aws.ec2.get_elastic_ip(filters=[aws.ec2.GetElasticIpFilterArgs(
name="tag:Name",
values=["exampleNameTagValue"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const byFilter = pulumi.output(aws.ec2.getElasticIp({
filters: [{
name: "tag:Name",
values: ["exampleNameTagValue"],
}],
}, { async: true }));
Search By Public IP (EC2-Classic or VPC)
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var byPublicIp = Output.Create(Aws.Ec2.GetElasticIp.InvokeAsync(new Aws.Ec2.GetElasticIpArgs
{
PublicIp = "1.2.3.4",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := "1.2.3.4"
_, err := ec2.GetElasticIp(ctx, &ec2.GetElasticIpArgs{
PublicIp: &opt0,
}, nil)
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_aws as aws
by_public_ip = aws.ec2.get_elastic_ip(public_ip="1.2.3.4")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const byPublicIp = pulumi.output(aws.ec2.getElasticIp({
publicIp: "1.2.3.4",
}, { async: true }));
Search By Tags (EC2-Classic or VPC)
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var byTags = Output.Create(Aws.Ec2.GetElasticIp.InvokeAsync(new Aws.Ec2.GetElasticIpArgs
{
Tags =
{
{ "Name", "exampleNameTagValue" },
},
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.GetElasticIp(ctx, &ec2.GetElasticIpArgs{
Tags: map[string]interface{}{
"Name": "exampleNameTagValue",
},
}, nil)
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_aws as aws
by_tags = aws.ec2.get_elastic_ip(tags={
"Name": "exampleNameTagValue",
})
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const byTags = pulumi.output(aws.ec2.getElasticIp({
tags: {
Name: "exampleNameTagValue",
},
}, { async: true }));
Using getElasticIp
function getElasticIp(args: GetElasticIpArgs, opts?: InvokeOptions): Promise<GetElasticIpResult>
def get_elastic_ip(filters: Optional[Sequence[GetElasticIpFilterArgs]] = None, id: Optional[str] = None, public_ip: Optional[str] = None, tags: Optional[Mapping[str, str]] = None, opts: Optional[InvokeOptions] = None) -> GetElasticIpResult
func GetElasticIp(ctx *Context, args *GetElasticIpArgs, opts ...InvokeOption) (*GetElasticIpResult, error)
Note: This function is named
GetElasticIp
in the Go SDK.
public static class GetElasticIp {
public static Task<GetElasticIpResult> InvokeAsync(GetElasticIpArgs args, InvokeOptions? opts = null)
}
The following arguments are supported:
- Filters
List<Get
Elastic Ip Filter Args> - One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out the EC2 API Reference.
- Id string
- The allocation id of the specific VPC EIP to retrieve. If a classic EIP is required, do NOT set
id
, only setpublic_ip
- Public
Ip string - The public IP of the specific EIP to retrieve.
- Dictionary<string, string>
- A map of tags, each pair of which must exactly match a pair on the desired Elastic IP
- Filters
[]Get
Elastic Ip Filter - One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out the EC2 API Reference.
- Id string
- The allocation id of the specific VPC EIP to retrieve. If a classic EIP is required, do NOT set
id
, only setpublic_ip
- Public
Ip string - The public IP of the specific EIP to retrieve.
- map[string]string
- A map of tags, each pair of which must exactly match a pair on the desired Elastic IP
- filters
Get
Elastic Ip Filter[] - One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out the EC2 API Reference.
- id string
- The allocation id of the specific VPC EIP to retrieve. If a classic EIP is required, do NOT set
id
, only setpublic_ip
- public
Ip string - The public IP of the specific EIP to retrieve.
- {[key: string]: string}
- A map of tags, each pair of which must exactly match a pair on the desired Elastic IP
- filters
Sequence[Get
Elastic Ip Filter Args] - One or more name/value pairs to use as filters. There are several valid keys, for a full reference, check out the EC2 API Reference.
- id str
- The allocation id of the specific VPC EIP to retrieve. If a classic EIP is required, do NOT set
id
, only setpublic_ip
- public_
ip str - The public IP of the specific EIP to retrieve.
- Mapping[str, str]
- A map of tags, each pair of which must exactly match a pair on the desired Elastic IP
getElasticIp Result
The following output properties are available:
- Association
Id string - The ID representing the association of the address with an instance in a VPC.
- Carrier
Ip string - The carrier IP address.
- Customer
Owned stringIp - Customer Owned IP.
- Customer
Owned stringIpv4Pool - The ID of a Customer Owned IP Pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide
- Domain string
- Indicates whether the address is for use in EC2-Classic (standard) or in a VPC (vpc).
- Id string
- If VPC Elastic IP, the allocation identifier. If EC2-Classic Elastic IP, the public IP address.
- Instance
Id string - The ID of the instance that the address is associated with (if any).
- Network
Interface stringId - The ID of the network interface.
- Network
Interface stringOwner Id - The ID of the AWS account that owns the network interface.
- Private
Dns string - The Private DNS associated with the Elastic IP address.
- Private
Ip string - The private IP address associated with the Elastic IP address.
- Public
Dns string - Public DNS associated with the Elastic IP address.
- Public
Ip string - Public IP address of Elastic IP.
- Public
Ipv4Pool string - The ID of an address pool.
- Dictionary<string, string>
- Key-value map of tags associated with Elastic IP.
- Filters
List<Get
Elastic Ip Filter>
- Association
Id string - The ID representing the association of the address with an instance in a VPC.
- Carrier
Ip string - The carrier IP address.
- Customer
Owned stringIp - Customer Owned IP.
- Customer
Owned stringIpv4Pool - The ID of a Customer Owned IP Pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide
- Domain string
- Indicates whether the address is for use in EC2-Classic (standard) or in a VPC (vpc).
- Id string
- If VPC Elastic IP, the allocation identifier. If EC2-Classic Elastic IP, the public IP address.
- Instance
Id string - The ID of the instance that the address is associated with (if any).
- Network
Interface stringId - The ID of the network interface.
- Network
Interface stringOwner Id - The ID of the AWS account that owns the network interface.
- Private
Dns string - The Private DNS associated with the Elastic IP address.
- Private
Ip string - The private IP address associated with the Elastic IP address.
- Public
Dns string - Public DNS associated with the Elastic IP address.
- Public
Ip string - Public IP address of Elastic IP.
- Public
Ipv4Pool string - The ID of an address pool.
- map[string]string
- Key-value map of tags associated with Elastic IP.
- Filters
[]Get
Elastic Ip Filter
- association
Id string - The ID representing the association of the address with an instance in a VPC.
- carrier
Ip string - The carrier IP address.
- customer
Owned stringIp - Customer Owned IP.
- customer
Owned stringIpv4Pool - The ID of a Customer Owned IP Pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide
- domain string
- Indicates whether the address is for use in EC2-Classic (standard) or in a VPC (vpc).
- id string
- If VPC Elastic IP, the allocation identifier. If EC2-Classic Elastic IP, the public IP address.
- instance
Id string - The ID of the instance that the address is associated with (if any).
- network
Interface stringId - The ID of the network interface.
- network
Interface stringOwner Id - The ID of the AWS account that owns the network interface.
- private
Dns string - The Private DNS associated with the Elastic IP address.
- private
Ip string - The private IP address associated with the Elastic IP address.
- public
Dns string - Public DNS associated with the Elastic IP address.
- public
Ip string - Public IP address of Elastic IP.
- public
Ipv4Pool string - The ID of an address pool.
- {[key: string]: string}
- Key-value map of tags associated with Elastic IP.
- filters
Get
Elastic Ip Filter[]
- association_
id str - The ID representing the association of the address with an instance in a VPC.
- carrier_
ip str - The carrier IP address.
- customer_
owned_ strip - Customer Owned IP.
- customer_
owned_ stripv4_ pool - The ID of a Customer Owned IP Pool. For more on customer owned IP addressed check out Customer-owned IP addresses guide
- domain str
- Indicates whether the address is for use in EC2-Classic (standard) or in a VPC (vpc).
- id str
- If VPC Elastic IP, the allocation identifier. If EC2-Classic Elastic IP, the public IP address.
- instance_
id str - The ID of the instance that the address is associated with (if any).
- network_
interface_ strid - The ID of the network interface.
- network_
interface_ strowner_ id - The ID of the AWS account that owns the network interface.
- private_
dns str - The Private DNS associated with the Elastic IP address.
- private_
ip str - The private IP address associated with the Elastic IP address.
- public_
dns str - Public DNS associated with the Elastic IP address.
- public_
ip str - Public IP address of Elastic IP.
- public_
ipv4_ strpool - The ID of an address pool.
- Mapping[str, str]
- Key-value map of tags associated with Elastic IP.
- filters
Sequence[Get
Elastic Ip Filter]
Supporting Types
GetElasticIpFilter
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.