AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getEips

Provides a list of Elastic IPs in a region.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Ec2.GetEips.InvokeAsync(new Aws.Ec2.GetEipsArgs
        {
            Tags = 
            {
                { "Env", "dev" },
            },
        }));
        this.AllocationIds = example.Apply(example => example.AllocationIds);
        this.PublicIps = example.Apply(example => example.PublicIps);
    }

    [Output("allocationIds")]
    public Output<string> AllocationIds { get; set; }
    [Output("publicIps")]
    public Output<string> PublicIps { get; set; }
}
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 {
		example, err := ec2.GetEips(ctx, &ec2.GetEipsArgs{
			Tags: map[string]interface{}{
				"Env": "dev",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("allocationIds", example.AllocationIds)
		ctx.Export("publicIps", example.PublicIps)
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(Ec2Functions.getEips(GetEipsArgs.builder()
            .tags(Map.of("Env", "dev"))
            .build()));

        ctx.export("allocationIds", example.apply(getEipsResult -> getEipsResult.getAllocationIds()));
        ctx.export("publicIps", example.apply(getEipsResult -> getEipsResult.getPublicIps()));
        }
}
import pulumi
import pulumi_aws as aws

example = aws.ec2.get_eips(tags={
    "Env": "dev",
})
pulumi.export("allocationIds", example.allocation_ids)
pulumi.export("publicIps", example.public_ips)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.ec2.getEips({
    tags: {
        Env: "dev",
    },
});
export const allocationIds = example.then(example => example.allocationIds);
export const publicIps = example.then(example => example.publicIps);
variables:
  example:
    Fn::Invoke:
      Function: aws:ec2:getEips
      Arguments:
        tags:
          Env: dev
outputs:
  allocationIds: ${example.allocationIds}
  publicIps: ${example.publicIps}

Using getEips

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getEips(args: GetEipsArgs, opts?: InvokeOptions): Promise<GetEipsResult>
function getEipsOutput(args: GetEipsOutputArgs, opts?: InvokeOptions): Output<GetEipsResult>
def get_eips(filters: Optional[Sequence[GetEipsFilter]] = None,
             tags: Optional[Mapping[str, str]] = None,
             opts: Optional[InvokeOptions] = None) -> GetEipsResult
def get_eips_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetEipsFilterArgs]]]] = None,
             tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetEipsResult]
func GetEips(ctx *Context, args *GetEipsArgs, opts ...InvokeOption) (*GetEipsResult, error)
func GetEipsOutput(ctx *Context, args *GetEipsOutputArgs, opts ...InvokeOption) GetEipsResultOutput

> Note: This function is named GetEips in the Go SDK.

public static class GetEips 
{
    public static Task<GetEipsResult> InvokeAsync(GetEipsArgs args, InvokeOptions? opts = null)
    public static Output<GetEipsResult> Invoke(GetEipsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEipsResult> getEips(GetEipsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:ec2/getEips:getEips
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Filters List<Pulumi.Aws.Ec2.Inputs.GetEipsFilter>

Custom filter block as described below.

Tags Dictionary<string, string>

A map of tags, each pair of which must exactly match a pair on the desired Elastic IPs.

Filters []GetEipsFilter

Custom filter block as described below.

Tags map[string]string

A map of tags, each pair of which must exactly match a pair on the desired Elastic IPs.

filters ListEipsFilter>

Custom filter block as described below.

tags Map

A map of tags, each pair of which must exactly match a pair on the desired Elastic IPs.

filters GetEipsFilter[]

Custom filter block as described below.

tags {[key: string]: string}

A map of tags, each pair of which must exactly match a pair on the desired Elastic IPs.

filters Sequence[GetEipsFilter]

Custom filter block as described below.

tags Mapping[str, str]

A map of tags, each pair of which must exactly match a pair on the desired Elastic IPs.

filters List

Custom filter block as described below.

tags Map

A map of tags, each pair of which must exactly match a pair on the desired Elastic IPs.

getEips Result

The following output properties are available:

AllocationIds List<string>

A list of all the allocation IDs for address for use with EC2-VPC.

Id string

The provider-assigned unique ID for this managed resource.

PublicIps List<string>

A list of all the Elastic IP addresses.

Tags Dictionary<string, string>
Filters List<Pulumi.Aws.Ec2.Outputs.GetEipsFilter>
AllocationIds []string

A list of all the allocation IDs for address for use with EC2-VPC.

Id string

The provider-assigned unique ID for this managed resource.

PublicIps []string

A list of all the Elastic IP addresses.

Tags map[string]string
Filters []GetEipsFilter
allocationIds List

A list of all the allocation IDs for address for use with EC2-VPC.

id String

The provider-assigned unique ID for this managed resource.

publicIps List

A list of all the Elastic IP addresses.

tags Map
filters ListEipsFilter>
allocationIds string[]

A list of all the allocation IDs for address for use with EC2-VPC.

id string

The provider-assigned unique ID for this managed resource.

publicIps string[]

A list of all the Elastic IP addresses.

tags {[key: string]: string}
filters GetEipsFilter[]
allocation_ids Sequence[str]

A list of all the allocation IDs for address for use with EC2-VPC.

id str

The provider-assigned unique ID for this managed resource.

public_ips Sequence[str]

A list of all the Elastic IP addresses.

tags Mapping[str, str]
filters Sequence[GetEipsFilter]
allocationIds List

A list of all the allocation IDs for address for use with EC2-VPC.

id String

The provider-assigned unique ID for this managed resource.

publicIps List

A list of all the Elastic IP addresses.

tags Map
filters List

Supporting Types

GetEipsFilter

Name string

The name of the field to filter by, as defined by the underlying AWS API.

Values List<string>

Set of values that are accepted for the given field. An Elastic IP will be selected if any one of the given values matches.

Name string

The name of the field to filter by, as defined by the underlying AWS API.

Values []string

Set of values that are accepted for the given field. An Elastic IP will be selected if any one of the given values matches.

name String

The name of the field to filter by, as defined by the underlying AWS API.

values List

Set of values that are accepted for the given field. An Elastic IP will be selected if any one of the given values matches.

name string

The name of the field to filter by, as defined by the underlying AWS API.

values string[]

Set of values that are accepted for the given field. An Elastic IP will be selected if any one of the given values matches.

name str

The name of the field to filter by, as defined by the underlying AWS API.

values Sequence[str]

Set of values that are accepted for the given field. An Elastic IP will be selected if any one of the given values matches.

name String

The name of the field to filter by, as defined by the underlying AWS API.

values List

Set of values that are accepted for the given field. An Elastic IP will be selected if any one of the given values matches.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.