aws.ec2transitgateway.getVpnAttachment
Explore with Pulumi AI
Get information on an EC2 Transit Gateway VPN Attachment.
EC2 Transit Gateway VPN Attachments are implicitly created by VPN Connections referencing an EC2 Transit Gateway so there is no managed resource. For ease, the
aws.ec2.VpnConnection
resource includes atransit_gateway_attachment_id
attribute which can replace some usage of this data source. For tagging the attachment, see theaws.ec2.Tag
resource.
Example Usage
By Transit Gateway and VPN Connection Identifiers
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2transitgateway.getVpnAttachment({
transitGatewayId: exampleAwsEc2TransitGateway.id,
vpnConnectionId: exampleAwsVpnConnection.id,
});
import pulumi
import pulumi_aws as aws
example = aws.ec2transitgateway.get_vpn_attachment(transit_gateway_id=example_aws_ec2_transit_gateway["id"],
vpn_connection_id=example_aws_vpn_connection["id"])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2transitgateway.GetVpnAttachment(ctx, &ec2transitgateway.GetVpnAttachmentArgs{
TransitGatewayId: pulumi.StringRef(exampleAwsEc2TransitGateway.Id),
VpnConnectionId: pulumi.StringRef(exampleAwsVpnConnection.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Ec2TransitGateway.GetVpnAttachment.Invoke(new()
{
TransitGatewayId = exampleAwsEc2TransitGateway.Id,
VpnConnectionId = exampleAwsVpnConnection.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2transitgateway.Ec2transitgatewayFunctions;
import com.pulumi.aws.ec2transitgateway.inputs.GetVpnAttachmentArgs;
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 example = Ec2transitgatewayFunctions.getVpnAttachment(GetVpnAttachmentArgs.builder()
.transitGatewayId(exampleAwsEc2TransitGateway.id())
.vpnConnectionId(exampleAwsVpnConnection.id())
.build());
}
}
variables:
example:
fn::invoke:
Function: aws:ec2transitgateway:getVpnAttachment
Arguments:
transitGatewayId: ${exampleAwsEc2TransitGateway.id}
vpnConnectionId: ${exampleAwsVpnConnection.id}
Filter
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = aws.ec2transitgateway.getVpnAttachment({
filters: [{
name: "resource-id",
values: ["some-resource"],
}],
});
import pulumi
import pulumi_aws as aws
test = aws.ec2transitgateway.get_vpn_attachment(filters=[{
"name": "resource-id",
"values": ["some-resource"],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2transitgateway.GetVpnAttachment(ctx, &ec2transitgateway.GetVpnAttachmentArgs{
Filters: []ec2transitgateway.GetVpnAttachmentFilter{
{
Name: "resource-id",
Values: []string{
"some-resource",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = Aws.Ec2TransitGateway.GetVpnAttachment.Invoke(new()
{
Filters = new[]
{
new Aws.Ec2TransitGateway.Inputs.GetVpnAttachmentFilterInputArgs
{
Name = "resource-id",
Values = new[]
{
"some-resource",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2transitgateway.Ec2transitgatewayFunctions;
import com.pulumi.aws.ec2transitgateway.inputs.GetVpnAttachmentArgs;
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 test = Ec2transitgatewayFunctions.getVpnAttachment(GetVpnAttachmentArgs.builder()
.filters(GetVpnAttachmentFilterArgs.builder()
.name("resource-id")
.values("some-resource")
.build())
.build());
}
}
variables:
test:
fn::invoke:
Function: aws:ec2transitgateway:getVpnAttachment
Arguments:
filters:
- name: resource-id
values:
- some-resource
Using getVpnAttachment
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 getVpnAttachment(args: GetVpnAttachmentArgs, opts?: InvokeOptions): Promise<GetVpnAttachmentResult>
function getVpnAttachmentOutput(args: GetVpnAttachmentOutputArgs, opts?: InvokeOptions): Output<GetVpnAttachmentResult>
def get_vpn_attachment(filters: Optional[Sequence[GetVpnAttachmentFilter]] = None,
tags: Optional[Mapping[str, str]] = None,
transit_gateway_id: Optional[str] = None,
vpn_connection_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVpnAttachmentResult
def get_vpn_attachment_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpnAttachmentFilterArgs]]]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
transit_gateway_id: Optional[pulumi.Input[str]] = None,
vpn_connection_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpnAttachmentResult]
func GetVpnAttachment(ctx *Context, args *GetVpnAttachmentArgs, opts ...InvokeOption) (*GetVpnAttachmentResult, error)
func GetVpnAttachmentOutput(ctx *Context, args *GetVpnAttachmentOutputArgs, opts ...InvokeOption) GetVpnAttachmentResultOutput
> Note: This function is named GetVpnAttachment
in the Go SDK.
public static class GetVpnAttachment
{
public static Task<GetVpnAttachmentResult> InvokeAsync(GetVpnAttachmentArgs args, InvokeOptions? opts = null)
public static Output<GetVpnAttachmentResult> Invoke(GetVpnAttachmentInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVpnAttachmentResult> getVpnAttachment(GetVpnAttachmentArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ec2transitgateway/getVpnAttachment:getVpnAttachment
arguments:
# arguments dictionary
The following arguments are supported:
- Filters
List<Get
Vpn Attachment Filter> - Configuration block(s) for filtering. Detailed below.
- Dictionary<string, string>
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway VPN Attachment.
- Transit
Gateway stringId - Identifier of the EC2 Transit Gateway.
- Vpn
Connection stringId - Identifier of the EC2 VPN Connection.
- Filters
[]Get
Vpn Attachment Filter - Configuration block(s) for filtering. Detailed below.
- map[string]string
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway VPN Attachment.
- Transit
Gateway stringId - Identifier of the EC2 Transit Gateway.
- Vpn
Connection stringId - Identifier of the EC2 VPN Connection.
- filters
List<Get
Vpn Attachment Filter> - Configuration block(s) for filtering. Detailed below.
- Map<String,String>
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway VPN Attachment.
- transit
Gateway StringId - Identifier of the EC2 Transit Gateway.
- vpn
Connection StringId - Identifier of the EC2 VPN Connection.
- filters
Get
Vpn Attachment Filter[] - Configuration block(s) for filtering. Detailed below.
- {[key: string]: string}
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway VPN Attachment.
- transit
Gateway stringId - Identifier of the EC2 Transit Gateway.
- vpn
Connection stringId - Identifier of the EC2 VPN Connection.
- filters
Sequence[Get
Vpn Attachment Filter] - Configuration block(s) for filtering. Detailed below.
- Mapping[str, str]
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway VPN Attachment.
- transit_
gateway_ strid - Identifier of the EC2 Transit Gateway.
- vpn_
connection_ strid - Identifier of the EC2 VPN Connection.
- filters List<Property Map>
- Configuration block(s) for filtering. Detailed below.
- Map<String>
- Map of tags, each pair of which must exactly match a pair on the desired Transit Gateway VPN Attachment.
- transit
Gateway StringId - Identifier of the EC2 Transit Gateway.
- vpn
Connection StringId - 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.
- Dictionary<string, string>
- Key-value tags for the EC2 Transit Gateway VPN Attachment
- Filters
List<Get
Vpn Attachment Filter> - Transit
Gateway stringId - Vpn
Connection stringId
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- Key-value tags for the EC2 Transit Gateway VPN Attachment
- Filters
[]Get
Vpn Attachment Filter - Transit
Gateway stringId - Vpn
Connection stringId
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- Key-value tags for the EC2 Transit Gateway VPN Attachment
- filters
List<Get
Vpn Attachment Filter> - transit
Gateway StringId - vpn
Connection StringId
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- Key-value tags for the EC2 Transit Gateway VPN Attachment
- filters
Get
Vpn Attachment Filter[] - transit
Gateway stringId - vpn
Connection stringId
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- Key-value tags for the EC2 Transit Gateway VPN Attachment
- filters
Sequence[Get
Vpn Attachment Filter] - transit_
gateway_ strid - vpn_
connection_ strid
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
- Key-value tags for the EC2 Transit Gateway VPN Attachment
- filters List<Property Map>
- transit
Gateway StringId - vpn
Connection StringId
Supporting Types
GetVpnAttachmentFilter
- Name string
- 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
- 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
- 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
- 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
- Name of the filter field. Valid values can be found in the EC2 DescribeTransitGatewayAttachments API Reference.
- values Sequence[str]
- Set of values that are accepted for the given filter field. Results will be selected if any given value matches.
- name String
- 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.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.