AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

getLocalGateways

Provides information for multiple EC2 Local Gateways, such as their identifiers.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var fooLocalGateways = Output.Create(Aws.Ec2.GetLocalGateways.InvokeAsync(new Aws.Ec2.GetLocalGatewaysArgs
        {
            Tags = 
            {
                { "service", "production" },
            },
        }));
        this.Foo = fooLocalGateways.Apply(fooLocalGateways => fooLocalGateways.Ids);
    }

    [Output("foo")]
    public Output<string> Foo { 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 {
		fooLocalGateways, err := ec2.GetLocalGateways(ctx, &ec2.GetLocalGatewaysArgs{
			Tags: map[string]interface{}{
				"service": "production",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("foo", fooLocalGateways.Ids)
		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 fooLocalGateways = Output.of(Ec2Functions.getLocalGateways(GetLocalGatewaysArgs.builder()
            .tags(Map.of("service", "production"))
            .build()));

        ctx.export("foo", fooLocalGateways.apply(getLocalGatewaysResult -> getLocalGatewaysResult.ids()));
    }
}
import pulumi
import pulumi_aws as aws

foo_local_gateways = aws.ec2.get_local_gateways(tags={
    "service": "production",
})
pulumi.export("foo", foo_local_gateways.ids)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const fooLocalGateways = aws.ec2.getLocalGateways({
    tags: {
        service: "production",
    },
});
export const foo = fooLocalGateways.then(fooLocalGateways => fooLocalGateways.ids);
variables:
  fooLocalGateways:
    Fn::Invoke:
      Function: aws:ec2:getLocalGateways
      Arguments:
        tags:
          service: production
outputs:
  foo: ${fooLocalGateways.ids}

Using getLocalGateways

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 getLocalGateways(args: GetLocalGatewaysArgs, opts?: InvokeOptions): Promise<GetLocalGatewaysResult>
function getLocalGatewaysOutput(args: GetLocalGatewaysOutputArgs, opts?: InvokeOptions): Output<GetLocalGatewaysResult>
def get_local_gateways(filters: Optional[Sequence[GetLocalGatewaysFilter]] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       opts: Optional[InvokeOptions] = None) -> GetLocalGatewaysResult
def get_local_gateways_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLocalGatewaysFilterArgs]]]] = None,
                       tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetLocalGatewaysResult]
func GetLocalGateways(ctx *Context, args *GetLocalGatewaysArgs, opts ...InvokeOption) (*GetLocalGatewaysResult, error)
func GetLocalGatewaysOutput(ctx *Context, args *GetLocalGatewaysOutputArgs, opts ...InvokeOption) GetLocalGatewaysResultOutput

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

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

The following arguments are supported:

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

Custom filter block as described below.

Tags Dictionary<string, string>

A mapping of tags, each pair of which must exactly match a pair on the desired local_gateways.

Filters []GetLocalGatewaysFilter

Custom filter block as described below.

Tags map[string]string

A mapping of tags, each pair of which must exactly match a pair on the desired local_gateways.

filters List<GetLocalGatewaysFilter>

Custom filter block as described below.

tags Map<String,String>

A mapping of tags, each pair of which must exactly match a pair on the desired local_gateways.

filters GetLocalGatewaysFilter[]

Custom filter block as described below.

tags {[key: string]: string}

A mapping of tags, each pair of which must exactly match a pair on the desired local_gateways.

filters Sequence[GetLocalGatewaysFilter]

Custom filter block as described below.

tags Mapping[str, str]

A mapping of tags, each pair of which must exactly match a pair on the desired local_gateways.

filters List<Property Map>

Custom filter block as described below.

tags Map<String>

A mapping of tags, each pair of which must exactly match a pair on the desired local_gateways.

getLocalGateways Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

Set of all the Local Gateway identifiers

Tags Dictionary<string, string>
Filters List<Pulumi.Aws.Ec2.Outputs.GetLocalGatewaysFilter>
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

Set of all the Local Gateway identifiers

Tags map[string]string
Filters []GetLocalGatewaysFilter
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

Set of all the Local Gateway identifiers

tags Map<String,String>
filters List<GetLocalGatewaysFilter>
id string

The provider-assigned unique ID for this managed resource.

ids string[]

Set of all the Local Gateway identifiers

tags {[key: string]: string}
filters GetLocalGatewaysFilter[]
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

Set of all the Local Gateway identifiers

tags Mapping[str, str]
filters Sequence[GetLocalGatewaysFilter]
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

Set of all the Local Gateway identifiers

tags Map<String>
filters List<Property Map>

Supporting Types

GetLocalGatewaysFilter

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. A Local Gateway 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. A Local Gateway 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<String>

Set of values that are accepted for the given field. A Local Gateway 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. A Local Gateway 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. A Local Gateway 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<String>

Set of values that are accepted for the given field. A Local Gateway 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.