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/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/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=[aws.ec2.GetVpnGatewayFilterArgs(
    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 = aws.ec2.getVpnGateway({
    filters: [{
        name: "tag:Name",
        values: ["vpn-gw"],
    }],
});
export const vpnGatewayId = selected.then(selected => selected.id);

Using getVpnGateway

function getVpnGateway(args: GetVpnGatewayArgs, opts?: InvokeOptions): Promise<GetVpnGatewayResult>
def get_vpn_gateway(amazon_side_asn: Optional[str] = None,
                    attached_vpc_id: Optional[str] = None,
                    availability_zone: Optional[str] = None,
                    filters: Optional[Sequence[GetVpnGatewayFilter]] = None,
                    id: Optional[str] = None,
                    state: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetVpnGatewayResult
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<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 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 Sequence[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 Mapping[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[]

Supporting Types

GetVpnGatewayFilter

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 Sequence[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.