aws.ec2.getVpnGateway
Explore with Pulumi AI
The VPN Gateway data source provides details about a specific VPN gateway.
Example Usage
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);
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)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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{
{
Name: "tag:Name",
Values: []string{
"vpn-gw",
},
},
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpnGatewayId", selected.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var selected = Aws.Ec2.GetVpnGateway.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2.Inputs.GetVpnGatewayFilterInputArgs
{
Name = "tag:Name",
Values = new[]
{
"vpn-gw",
},
},
},
});
return new Dictionary<string, object?>
{
["vpnGatewayId"] = selected.Apply(getVpnGatewayResult => getVpnGatewayResult.Id),
};
});
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.GetVpnGatewayArgs;
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 selected = Ec2Functions.getVpnGateway(GetVpnGatewayArgs.builder()
.filters(GetVpnGatewayFilterArgs.builder()
.name("tag:Name")
.values("vpn-gw")
.build())
.build());
ctx.export("vpnGatewayId", selected.applyValue(getVpnGatewayResult -> getVpnGatewayResult.id()));
}
}
variables:
selected:
fn::invoke:
Function: aws:ec2:getVpnGateway
Arguments:
filters:
- name: tag:Name
values:
- vpn-gw
outputs:
vpnGatewayId: ${selected.id}
Using getVpnGateway
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 getVpnGateway(args: GetVpnGatewayArgs, opts?: InvokeOptions): Promise<GetVpnGatewayResult>
function getVpnGatewayOutput(args: GetVpnGatewayOutputArgs, opts?: InvokeOptions): Output<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
def get_vpn_gateway_output(amazon_side_asn: Optional[pulumi.Input[str]] = None,
attached_vpc_id: Optional[pulumi.Input[str]] = None,
availability_zone: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpnGatewayFilterArgs]]]] = 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[GetVpnGatewayResult]
func LookupVpnGateway(ctx *Context, args *LookupVpnGatewayArgs, opts ...InvokeOption) (*LookupVpnGatewayResult, error)
func LookupVpnGatewayOutput(ctx *Context, args *LookupVpnGatewayOutputArgs, opts ...InvokeOption) LookupVpnGatewayResultOutput
> Note: This function is named LookupVpnGateway
in the Go SDK.
public static class GetVpnGateway
{
public static Task<GetVpnGatewayResult> InvokeAsync(GetVpnGatewayArgs args, InvokeOptions? opts = null)
public static Output<GetVpnGatewayResult> Invoke(GetVpnGatewayInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVpnGatewayResult> getVpnGateway(GetVpnGatewayArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ec2/getVpnGateway:getVpnGateway
arguments:
# arguments dictionary
The following arguments are supported:
- Amazon
Side stringAsn Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- Attached
Vpc stringId - ID of a VPC attached to the specific VPN Gateway to retrieve.
- Availability
Zone string - Availability Zone of the specific VPN Gateway to retrieve.
- Filters
List<Get
Vpn Gateway Filter> - Custom filter block as described below.
- Id string
- ID of the specific VPN Gateway to retrieve.
- State string
- State of the specific VPN Gateway to retrieve.
- Dictionary<string, string>
- Map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- Amazon
Side stringAsn Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- Attached
Vpc stringId - ID of a VPC attached to the specific VPN Gateway to retrieve.
- Availability
Zone string - Availability Zone of the specific VPN Gateway to retrieve.
- Filters
[]Get
Vpn Gateway Filter - Custom filter block as described below.
- Id string
- ID of the specific VPN Gateway to retrieve.
- State string
- State of the specific VPN Gateway to retrieve.
- map[string]string
- Map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- amazon
Side StringAsn Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- attached
Vpc StringId - ID of a VPC attached to the specific VPN Gateway to retrieve.
- availability
Zone String - Availability Zone of the specific VPN Gateway to retrieve.
- filters
List<Get
Vpn Gateway Filter> - Custom filter block as described below.
- id String
- ID of the specific VPN Gateway to retrieve.
- state String
- State of the specific VPN Gateway to retrieve.
- Map<String,String>
- Map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- amazon
Side stringAsn Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- attached
Vpc stringId - ID of a VPC attached to the specific VPN Gateway to retrieve.
- availability
Zone string - Availability Zone of the specific VPN Gateway to retrieve.
- filters
Get
Vpn Gateway Filter[] - Custom filter block as described below.
- id string
- ID of the specific VPN Gateway to retrieve.
- state string
- State of the specific VPN Gateway to retrieve.
- {[key: string]: string}
- Map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- amazon_
side_ strasn Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- attached_
vpc_ strid - ID of a VPC attached to the specific VPN Gateway to retrieve.
- availability_
zone str - Availability Zone of the specific VPN Gateway to retrieve.
- filters
Sequence[Get
Vpn Gateway Filter] - Custom filter block as described below.
- id str
- ID of the specific VPN Gateway to retrieve.
- state str
- State of the specific VPN Gateway to retrieve.
- Mapping[str, str]
- Map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
- amazon
Side StringAsn Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
More complex filters can be expressed using one or more
filter
sub-blocks, which take the following arguments:- attached
Vpc StringId - ID of a VPC attached to the specific VPN Gateway to retrieve.
- availability
Zone String - Availability Zone of the specific VPN Gateway to retrieve.
- filters List<Property Map>
- Custom filter block as described below.
- id String
- ID of the specific VPN Gateway to retrieve.
- state String
- State of the specific VPN Gateway to retrieve.
- Map<String>
- 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
- map[string]string
- Filters
[]Get
Vpn Gateway Filter
- amazon
Side StringAsn - arn String
- attached
Vpc StringId - availability
Zone String - id String
- state String
- Map<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[]
- amazon_
side_ strasn - arn str
- attached_
vpc_ strid - availability_
zone str - id str
- state str
- Mapping[str, str]
- filters
Sequence[Get
Vpn Gateway Filter]
- amazon
Side StringAsn - arn String
- attached
Vpc StringId - availability
Zone String - id String
- state String
- Map<String>
- filters List<Property Map>
Supporting Types
GetVpnGatewayFilter
- 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 VPN 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 VPN 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 VPN 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 VPN 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 VPN 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 VPN 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.