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
LookupVpnGatewayin the Go SDK.
public static class GetVpnGateway {
public static Task<GetVpnGatewayResult> InvokeAsync(GetVpnGatewayArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Amazon
Side stringAsn The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
- Attached
Vpc stringId The ID of a VPC attached to the specific VPN Gateway to retrieve.
- Availability
Zone string The Availability Zone of the specific VPN Gateway to retrieve.
- Filters
List<Get
Vpn Gateway Filter Args> 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.
- Dictionary<string, string>
A map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- Amazon
Side stringAsn The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
- Attached
Vpc stringId The ID of a VPC attached to the specific VPN Gateway to retrieve.
- Availability
Zone string The Availability Zone of the specific VPN Gateway to retrieve.
- Filters
[]Get
Vpn Gateway Filter 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.
- map[string]string
A map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- amazon
Side stringAsn The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
- attached
Vpc stringId The ID of a VPC attached to the specific VPN Gateway to retrieve.
- availability
Zone string The Availability Zone of the specific VPN Gateway to retrieve.
- filters
Get
Vpn Gateway Filter[] 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.
- {[key: string]: string}
A map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- amazon_
side_ strasn The Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
- attached_
vpc_ strid 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[Get
Vpn Gateway Filter] 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.
- 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:
- Amazon
Side stringAsn - Arn string
- Attached
Vpc stringId - Availability
Zone string - Id string
- State string
- Dictionary<string, string>
- Filters
List<Get
Vpn Gateway Filter>
- amazon
Side stringAsn - arn string
- attached
Vpc stringId - availability
Zone string - id string
- state string
- {[key: string]: string}
- filters
Get
Vpn Gateway Filter[]
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 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
awsTerraform Provider.