1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. getLocalGateway

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.ec2.getLocalGateway

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides details about an EC2 Local Gateway.

    Example Usage

    The following example shows how one might accept a local gateway id as a variable.

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const config = new pulumi.Config();
    const localGatewayId = config.requireObject("localGatewayId");
    const selected = aws.ec2.getLocalGateway({
        id: localGatewayId,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    config = pulumi.Config()
    local_gateway_id = config.require_object("localGatewayId")
    selected = aws.ec2.get_local_gateway(id=local_gateway_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		localGatewayId := cfg.RequireObject("localGatewayId")
    		_, err := ec2.GetLocalGateway(ctx, &ec2.GetLocalGatewayArgs{
    			Id: pulumi.StringRef(localGatewayId),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var localGatewayId = config.RequireObject<dynamic>("localGatewayId");
        var selected = Aws.Ec2.GetLocalGateway.Invoke(new()
        {
            Id = localGatewayId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.Ec2Functions;
    import com.pulumi.aws.ec2.inputs.GetLocalGatewayArgs;
    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) {
            final var config = ctx.config();
            final var localGatewayId = config.get("localGatewayId");
            final var selected = Ec2Functions.getLocalGateway(GetLocalGatewayArgs.builder()
                .id(localGatewayId)
                .build());
    
        }
    }
    
    configuration:
      localGatewayId:
        type: dynamic
    variables:
      selected:
        fn::invoke:
          Function: aws:ec2:getLocalGateway
          Arguments:
            id: ${localGatewayId}
    

    Using getLocalGateway

    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 getLocalGateway(args: GetLocalGatewayArgs, opts?: InvokeOptions): Promise<GetLocalGatewayResult>
    function getLocalGatewayOutput(args: GetLocalGatewayOutputArgs, opts?: InvokeOptions): Output<GetLocalGatewayResult>
    def get_local_gateway(filters: Optional[Sequence[GetLocalGatewayFilter]] = None,
                          id: Optional[str] = None,
                          state: Optional[str] = None,
                          tags: Optional[Mapping[str, str]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetLocalGatewayResult
    def get_local_gateway_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLocalGatewayFilterArgs]]]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          state: Optional[pulumi.Input[str]] = None,
                          tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetLocalGatewayResult]
    func GetLocalGateway(ctx *Context, args *GetLocalGatewayArgs, opts ...InvokeOption) (*GetLocalGatewayResult, error)
    func GetLocalGatewayOutput(ctx *Context, args *GetLocalGatewayOutputArgs, opts ...InvokeOption) GetLocalGatewayResultOutput

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

    public static class GetLocalGateway 
    {
        public static Task<GetLocalGatewayResult> InvokeAsync(GetLocalGatewayArgs args, InvokeOptions? opts = null)
        public static Output<GetLocalGatewayResult> Invoke(GetLocalGatewayInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLocalGatewayResult> getLocalGateway(GetLocalGatewayArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getLocalGateway:getLocalGateway
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetLocalGatewayFilter>
    Custom filter block as described below.
    Id string
    Id of the specific Local Gateway to retrieve.
    State string
    Current state of the desired Local Gateway. Can be either "pending" or "available".
    Tags Dictionary<string, string>

    Mapping of tags, each pair of which must exactly match a pair on the desired Local Gateway.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    Filters []GetLocalGatewayFilter
    Custom filter block as described below.
    Id string
    Id of the specific Local Gateway to retrieve.
    State string
    Current state of the desired Local Gateway. Can be either "pending" or "available".
    Tags map[string]string

    Mapping of tags, each pair of which must exactly match a pair on the desired Local Gateway.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters List<GetLocalGatewayFilter>
    Custom filter block as described below.
    id String
    Id of the specific Local Gateway to retrieve.
    state String
    Current state of the desired Local Gateway. Can be either "pending" or "available".
    tags Map<String,String>

    Mapping of tags, each pair of which must exactly match a pair on the desired Local Gateway.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters GetLocalGatewayFilter[]
    Custom filter block as described below.
    id string
    Id of the specific Local Gateway to retrieve.
    state string
    Current state of the desired Local Gateway. Can be either "pending" or "available".
    tags {[key: string]: string}

    Mapping of tags, each pair of which must exactly match a pair on the desired Local Gateway.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters Sequence[GetLocalGatewayFilter]
    Custom filter block as described below.
    id str
    Id of the specific Local Gateway to retrieve.
    state str
    Current state of the desired Local Gateway. Can be either "pending" or "available".
    tags Mapping[str, str]

    Mapping of tags, each pair of which must exactly match a pair on the desired Local Gateway.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters List<Property Map>
    Custom filter block as described below.
    id String
    Id of the specific Local Gateway to retrieve.
    state String
    Current state of the desired Local Gateway. Can be either "pending" or "available".
    tags Map<String>

    Mapping of tags, each pair of which must exactly match a pair on the desired Local Gateway.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    getLocalGateway Result

    The following output properties are available:

    Id string
    OutpostArn string
    ARN of Outpost
    OwnerId string
    AWS account identifier that owns the Local Gateway.
    State string
    State of the local gateway.
    Tags Dictionary<string, string>
    Filters List<GetLocalGatewayFilter>
    Id string
    OutpostArn string
    ARN of Outpost
    OwnerId string
    AWS account identifier that owns the Local Gateway.
    State string
    State of the local gateway.
    Tags map[string]string
    Filters []GetLocalGatewayFilter
    id String
    outpostArn String
    ARN of Outpost
    ownerId String
    AWS account identifier that owns the Local Gateway.
    state String
    State of the local gateway.
    tags Map<String,String>
    filters List<GetLocalGatewayFilter>
    id string
    outpostArn string
    ARN of Outpost
    ownerId string
    AWS account identifier that owns the Local Gateway.
    state string
    State of the local gateway.
    tags {[key: string]: string}
    filters GetLocalGatewayFilter[]
    id str
    outpost_arn str
    ARN of Outpost
    owner_id str
    AWS account identifier that owns the Local Gateway.
    state str
    State of the local gateway.
    tags Mapping[str, str]
    filters Sequence[GetLocalGatewayFilter]
    id String
    outpostArn String
    ARN of Outpost
    ownerId String
    AWS account identifier that owns the Local Gateway.
    state String
    State of the local gateway.
    tags Map<String>
    filters List<Property Map>

    Supporting Types

    GetLocalGatewayFilter

    Name string
    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
    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
    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
    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
    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
    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
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi