GetVpnAttachment

Get information on an EC2 Transit Gateway VPN Attachment.

Example Usage

By Transit Gateway and VPN Connection Identifiers

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Ec2TransitGateway.GetVpnAttachment.InvokeAsync(new Aws.Ec2TransitGateway.GetVpnAttachmentArgs
        {
            TransitGatewayId = aws_ec2_transit_gateway.Example.Id,
            VpnConnectionId = aws_vpn_connection.Example.Id,
        }));
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := aws_ec2_transit_gateway.Example.Id
        opt1 := aws_vpn_connection.Example.Id
        _, err := ec2transitgateway.GetVpnAttachment(ctx, &ec2transitgateway.GetVpnAttachmentArgs{
            TransitGatewayId: &opt0,
            VpnConnectionId:  &opt1,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.get_vpn_attachment(transit_gateway_id=aws_ec2_transit_gateway["example"]["id"],
    vpn_connection_id=aws_vpn_connection["example"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.all([aws_ec2_transit_gateway_example.id, aws_vpn_connection_example.id]).apply(([aws_ec2_transit_gateway_exampleId, aws_vpn_connection_exampleId]) => aws.ec2transitgateway.getVpnAttachment({
    transitGatewayId: aws_ec2_transit_gateway_exampleId,
    vpnConnectionId: aws_vpn_connection_exampleId,
}, { async: true }));

Filter

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Aws.Ec2TransitGateway.GetVpnAttachment.InvokeAsync(new Aws.Ec2TransitGateway.GetVpnAttachmentArgs
        {
            Filters = 
            {
                new Aws.Ec2TransitGateway.Inputs.GetVpnAttachmentFilterArgs
                {
                    Name = "resource-id",
                    Values = 
                    {
                        "some-resource",
                    },
                },
            },
        }));
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2transitgateway.GetVpnAttachment(ctx, &ec2transitgateway.GetVpnAttachmentArgs{
            Filters: []ec2transitgateway.GetVpnAttachmentFilter{
                ec2transitgateway.GetVpnAttachmentFilter{
                    Name: "resource-id",
                    Values: []string{
                        "some-resource",
                    },
                },
            },
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

test = aws.ec2transitgateway.get_vpn_attachment(filters=[{
    "name": "resource-id",
    "values": ["some-resource"],
}])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = pulumi.output(aws.ec2transitgateway.getVpnAttachment({
    filters: [{
        name: "resource-id",
        values: ["some-resource"],
    }],
}, { async: true }));

Using GetVpnAttachment

function getVpnAttachment(args: GetVpnAttachmentArgs, opts?: InvokeOptions): Promise<GetVpnAttachmentResult>
function  get_vpn_attachment(filters=None, tags=None, transit_gateway_id=None, vpn_connection_id=None, opts=None)
func GetVpnAttachment(ctx *Context, args *GetVpnAttachmentArgs, opts ...InvokeOption) (*GetVpnAttachmentResult, error)
public static class GetVpnAttachment {
    public static Task<GetVpnAttachmentResult> InvokeAsync(GetVpnAttachmentArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<GetVpnAttachmentFilterArgs>

Configuration block(s) for filtering. Detailed below.

Tags Dictionary<string, string>

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

TransitGatewayId string

Identifier of the EC2 Transit Gateway.

VpnConnectionId string

Identifier of the EC2 VPN Connection.

Filters []GetVpnAttachmentFilter

Configuration block(s) for filtering. Detailed below.

Tags map[string]string

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

TransitGatewayId string

Identifier of the EC2 Transit Gateway.

VpnConnectionId string

Identifier of the EC2 VPN Connection.

filters GetVpnAttachmentFilter[]

Configuration block(s) for filtering. Detailed below.

tags {[key: string]: string}

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

transitGatewayId string

Identifier of the EC2 Transit Gateway.

vpnConnectionId string

Identifier of the EC2 VPN Connection.

filters List[GetVpnAttachmentFilter]

Configuration block(s) for filtering. Detailed below.

tags Dict[str, str]

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

transit_gateway_id str

Identifier of the EC2 Transit Gateway.

vpn_connection_id str

Identifier of the EC2 VPN Connection.

GetVpnAttachment Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Tags Dictionary<string, string>

Key-value tags for the EC2 Transit Gateway VPN Attachment

Filters List<GetVpnAttachmentFilter>
TransitGatewayId string
VpnConnectionId string
Id string

The provider-assigned unique ID for this managed resource.

Tags map[string]string

Key-value tags for the EC2 Transit Gateway VPN Attachment

Filters []GetVpnAttachmentFilter
TransitGatewayId string
VpnConnectionId string
id string

The provider-assigned unique ID for this managed resource.

tags {[key: string]: string}

Key-value tags for the EC2 Transit Gateway VPN Attachment

filters GetVpnAttachmentFilter[]
transitGatewayId string
vpnConnectionId string
id str

The provider-assigned unique ID for this managed resource.

tags Dict[str, str]

Key-value tags for the EC2 Transit Gateway VPN Attachment

filters List[GetVpnAttachmentFilter]
transit_gateway_id str
vpn_connection_id str

Supporting Types

GetVpnAttachmentFilter

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 filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.

Values List<string>

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

Name string

The name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.

Values []string

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name string

The name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.

values string[]

Set of values that are accepted for the given filter field. Results will be selected if any given value matches.

name str

The name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.

values List[str]

Set of values that are accepted for the given filter field. Results will be selected if any given value 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.