get Vpn Gateway
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)
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 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
})
}
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.id());
}
}
variables:
selected:
fn::invoke:
function: aws:ec2:getVpnGateway
arguments:
filters:
- name: tag:Name
values:
- vpn-gw
outputs:
vpnGatewayId: ${selected.id}
Return
A collection of values returned by getVpnGateway.
Parameters
A collection of arguments for invoking getVpnGateway.
Return
A collection of values returned by getVpnGateway.
Parameters
Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve. The arguments of this data source act as filters for querying the available VPN gateways. The given filters must match exactly one VPN gateway whose data will be exported as attributes.
ID of a VPC attached to the specific VPN Gateway to retrieve.
Availability Zone of the specific VPN Gateway to retrieve.
Custom filter block as described below.
ID of the specific VPN Gateway to retrieve.
State of the specific VPN Gateway to retrieve.
Map of tags, each pair of which must exactly match a pair on the desired VPN Gateway.
See also
Return
A collection of values returned by getVpnGateway.
Parameters
Builder for com.pulumi.aws.ec2.kotlin.inputs.GetVpnGatewayPlainArgs.