GetVpnGateway

The VPN Gateway data source provides details about a specific VPN gateway.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var selected = Output.Create(Aws.Ec2.GetVpnGateway.InvokeAsync(new Aws.Ec2.GetVpnGatewayArgs
        {
            Filters = 
            {
                new Aws.Ec2.Inputs.GetVpnGatewayFilterArgs
                {
                    Name = "tag:Name",
                    Values = 
                    {
                        "vpn-gw",
                    },
                },
            },
        }));
        this.VpnGatewayId = selected.Apply(selected => selected.Id);
    }

    [Output("vpnGatewayId")]
    public Output<string> VpnGatewayId { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        selected, err := ec2.LookupVpnGateway(ctx, &ec2.LookupVpnGatewayArgs{
            Filters: []ec2.GetVpnGatewayFilter{
                ec2.GetVpnGatewayFilter{
                    Name: "tag:Name",
                    Values: []string{
                        "vpn-gw",
                    },
                },
            },
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("vpnGatewayId", selected.Id)
        return nil
    })
}
import pulumi
import pulumi_aws as aws

selected = aws.ec2.get_vpn_gateway(filters=[{
    "name": "tag:Name",
    "values": ["vpn-gw"],
}])
pulumi.export("vpnGatewayId", selected.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const selected = pulumi.output(aws.ec2.getVpnGateway({
    filters: [{
        name: "tag:Name",
        values: ["vpn-gw"],
    }],
}, { async: true }));

export const vpnGatewayId = selected.id!;

Using GetVpnGateway

function getVpnGateway(args: GetVpnGatewayArgs, opts?: InvokeOptions): Promise<GetVpnGatewayResult>
function  get_vpn_gateway(amazon_side_asn=None, attached_vpc_id=None, availability_zone=None, filters=None, id=None, state=None, tags=None, opts=None)
func LookupVpnGateway(ctx *Context, args *LookupVpnGatewayArgs, opts ...InvokeOption) (*LookupVpnGatewayResult, error)

Note: This function is named LookupVpnGateway in the Go SDK.

public static class GetVpnGateway {
    public static Task<GetVpnGatewayResult> InvokeAsync(GetVpnGatewayArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

AmazonSideAsn string

The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.

AttachedVpcId string

The ID of a VPC attached to the specific VPN Gateway to retrieve.

AvailabilityZone string

The Availability Zone of the specific VPN Gateway to retrieve.

Filters List<GetVpnGatewayFilterArgs>

Custom filter block as described below.

Id string

The ID of the specific VPN Gateway to retrieve.

State string

The state of the specific VPN Gateway to retrieve.

Tags Dictionary<string, string>

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

AmazonSideAsn string

The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.

AttachedVpcId string

The ID of a VPC attached to the specific VPN Gateway to retrieve.

AvailabilityZone string

The Availability Zone of the specific VPN Gateway to retrieve.

Filters []GetVpnGatewayFilter

Custom filter block as described below.

Id string

The ID of the specific VPN Gateway to retrieve.

State string

The state of the specific VPN Gateway to retrieve.

Tags map[string]string

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

amazonSideAsn string

The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.

attachedVpcId string

The ID of a VPC attached to the specific VPN Gateway to retrieve.

availabilityZone string

The Availability Zone of the specific VPN Gateway to retrieve.

filters GetVpnGatewayFilter[]

Custom filter block as described below.

id string

The ID of the specific VPN Gateway to retrieve.

state string

The state of the specific VPN Gateway to retrieve.

tags {[key: string]: string}

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

amazon_side_asn str

The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.

attached_vpc_id str

The ID of a VPC attached to the specific VPN Gateway to retrieve.

availability_zone str

The Availability Zone of the specific VPN Gateway to retrieve.

filters List[GetVpnGatewayFilter]

Custom filter block as described below.

id str

The ID of the specific VPN Gateway to retrieve.

state str

The state of the specific VPN Gateway to retrieve.

tags Dict[str, str]

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

GetVpnGateway Result

The following output properties are available:

AmazonSideAsn string
Arn string
AttachedVpcId string
AvailabilityZone string
Id string
State string
Tags Dictionary<string, string>
Filters List<GetVpnGatewayFilter>
AmazonSideAsn string
Arn string
AttachedVpcId string
AvailabilityZone string
Id string
State string
Tags map[string]string
Filters []GetVpnGatewayFilter
amazonSideAsn string
arn string
attachedVpcId string
availabilityZone string
id string
state string
tags {[key: string]: string}
filters GetVpnGatewayFilter[]
amazon_side_asn str
arn str
attached_vpc_id str
availability_zone str
id str
state str
tags Dict[str, str]
filters List[GetVpnGatewayFilter]

Supporting Types

GetVpnGatewayFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 VPN 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 VPN 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 VPN 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 List[str]

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