AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi
aws.ec2transitgateway.getVpcAttachment
Explore with Pulumi AI
Get information on an EC2 Transit Gateway VPC Attachment.
Example Usage
By Filter
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2transitgateway.getVpcAttachment({
    filters: [{
        name: "vpc-id",
        values: ["vpc-12345678"],
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.ec2transitgateway.get_vpc_attachment(filters=[{
    "name": "vpc-id",
    "values": ["vpc-12345678"],
}])
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.LookupVpcAttachment(ctx, &ec2transitgateway.LookupVpcAttachmentArgs{
			Filters: []ec2transitgateway.GetVpcAttachmentFilter{
				{
					Name: "vpc-id",
					Values: []string{
						"vpc-12345678",
					},
				},
			},
		}, 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.GetVpcAttachment.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2TransitGateway.Inputs.GetVpcAttachmentFilterInputArgs
            {
                Name = "vpc-id",
                Values = new[]
                {
                    "vpc-12345678",
                },
            },
        },
    });
});
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.GetVpcAttachmentArgs;
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.getVpcAttachment(GetVpcAttachmentArgs.builder()
            .filters(GetVpcAttachmentFilterArgs.builder()
                .name("vpc-id")
                .values("vpc-12345678")
                .build())
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:ec2transitgateway:getVpcAttachment
      arguments:
        filters:
          - name: vpc-id
            values:
              - vpc-12345678
By Identifier
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ec2transitgateway.getVpcAttachment({
    id: "tgw-attach-12345678",
});
import pulumi
import pulumi_aws as aws
example = aws.ec2transitgateway.get_vpc_attachment(id="tgw-attach-12345678")
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.LookupVpcAttachment(ctx, &ec2transitgateway.LookupVpcAttachmentArgs{
			Id: pulumi.StringRef("tgw-attach-12345678"),
		}, 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.GetVpcAttachment.Invoke(new()
    {
        Id = "tgw-attach-12345678",
    });
});
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.GetVpcAttachmentArgs;
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.getVpcAttachment(GetVpcAttachmentArgs.builder()
            .id("tgw-attach-12345678")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:ec2transitgateway:getVpcAttachment
      arguments:
        id: tgw-attach-12345678
Using getVpcAttachment
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 getVpcAttachment(args: GetVpcAttachmentArgs, opts?: InvokeOptions): Promise<GetVpcAttachmentResult>
function getVpcAttachmentOutput(args: GetVpcAttachmentOutputArgs, opts?: InvokeOptions): Output<GetVpcAttachmentResult>def get_vpc_attachment(filters: Optional[Sequence[GetVpcAttachmentFilter]] = None,
                       id: Optional[str] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       opts: Optional[InvokeOptions] = None) -> GetVpcAttachmentResult
def get_vpc_attachment_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcAttachmentFilterArgs]]]] = None,
                       id: Optional[pulumi.Input[str]] = None,
                       tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetVpcAttachmentResult]func LookupVpcAttachment(ctx *Context, args *LookupVpcAttachmentArgs, opts ...InvokeOption) (*LookupVpcAttachmentResult, error)
func LookupVpcAttachmentOutput(ctx *Context, args *LookupVpcAttachmentOutputArgs, opts ...InvokeOption) LookupVpcAttachmentResultOutput> Note: This function is named LookupVpcAttachment in the Go SDK.
public static class GetVpcAttachment 
{
    public static Task<GetVpcAttachmentResult> InvokeAsync(GetVpcAttachmentArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcAttachmentResult> Invoke(GetVpcAttachmentInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcAttachmentResult> getVpcAttachment(GetVpcAttachmentArgs args, InvokeOptions options)
public static Output<GetVpcAttachmentResult> getVpcAttachment(GetVpcAttachmentArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2transitgateway/getVpcAttachment:getVpcAttachment
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Filters
List<GetVpc Attachment Filter> 
- One or more configuration blocks containing name-values filters. Detailed below.
- Id string
- Identifier of the EC2 Transit Gateway VPC Attachment.
- Dictionary<string, string>
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- Filters
[]GetVpc Attachment Filter 
- One or more configuration blocks containing name-values filters. Detailed below.
- Id string
- Identifier of the EC2 Transit Gateway VPC Attachment.
- map[string]string
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- filters
List<GetVpc Attachment Filter> 
- One or more configuration blocks containing name-values filters. Detailed below.
- id String
- Identifier of the EC2 Transit Gateway VPC Attachment.
- Map<String,String>
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- filters
GetVpc Attachment Filter[] 
- One or more configuration blocks containing name-values filters. Detailed below.
- id string
- Identifier of the EC2 Transit Gateway VPC Attachment.
- {[key: string]: string}
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- filters
Sequence[GetVpc Attachment Filter] 
- One or more configuration blocks containing name-values filters. Detailed below.
- id str
- Identifier of the EC2 Transit Gateway VPC Attachment.
- Mapping[str, str]
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- filters List<Property Map>
- One or more configuration blocks containing name-values filters. Detailed below.
- id String
- Identifier of the EC2 Transit Gateway VPC Attachment.
- Map<String>
- Key-value tags for the EC2 Transit Gateway VPC Attachment
getVpcAttachment Result
The following output properties are available:
- ApplianceMode stringSupport 
- Whether Appliance Mode support is enabled.
- Arn string
- ARN of the attachment.
- DnsSupport string
- Whether DNS support is enabled.
- Id string
- EC2 Transit Gateway VPC Attachment identifier
- Ipv6Support string
- Whether IPv6 support is enabled.
- SecurityGroup stringReferencing Support 
- Whether Security Group Referencing Support is enabled.
- SubnetIds List<string>
- Identifiers of EC2 Subnets.
- Dictionary<string, string>
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- TransitGateway stringId 
- EC2 Transit Gateway identifier
- VpcId string
- Identifier of EC2 VPC.
- VpcOwner stringId 
- Identifier of the AWS account that owns the EC2 VPC.
- Filters
List<GetVpc Attachment Filter> 
- ApplianceMode stringSupport 
- Whether Appliance Mode support is enabled.
- Arn string
- ARN of the attachment.
- DnsSupport string
- Whether DNS support is enabled.
- Id string
- EC2 Transit Gateway VPC Attachment identifier
- Ipv6Support string
- Whether IPv6 support is enabled.
- SecurityGroup stringReferencing Support 
- Whether Security Group Referencing Support is enabled.
- SubnetIds []string
- Identifiers of EC2 Subnets.
- map[string]string
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- TransitGateway stringId 
- EC2 Transit Gateway identifier
- VpcId string
- Identifier of EC2 VPC.
- VpcOwner stringId 
- Identifier of the AWS account that owns the EC2 VPC.
- Filters
[]GetVpc Attachment Filter 
- applianceMode StringSupport 
- Whether Appliance Mode support is enabled.
- arn String
- ARN of the attachment.
- dnsSupport String
- Whether DNS support is enabled.
- id String
- EC2 Transit Gateway VPC Attachment identifier
- ipv6Support String
- Whether IPv6 support is enabled.
- securityGroup StringReferencing Support 
- Whether Security Group Referencing Support is enabled.
- subnetIds List<String>
- Identifiers of EC2 Subnets.
- Map<String,String>
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- transitGateway StringId 
- EC2 Transit Gateway identifier
- vpcId String
- Identifier of EC2 VPC.
- vpcOwner StringId 
- Identifier of the AWS account that owns the EC2 VPC.
- filters
List<GetVpc Attachment Filter> 
- applianceMode stringSupport 
- Whether Appliance Mode support is enabled.
- arn string
- ARN of the attachment.
- dnsSupport string
- Whether DNS support is enabled.
- id string
- EC2 Transit Gateway VPC Attachment identifier
- ipv6Support string
- Whether IPv6 support is enabled.
- securityGroup stringReferencing Support 
- Whether Security Group Referencing Support is enabled.
- subnetIds string[]
- Identifiers of EC2 Subnets.
- {[key: string]: string}
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- transitGateway stringId 
- EC2 Transit Gateway identifier
- vpcId string
- Identifier of EC2 VPC.
- vpcOwner stringId 
- Identifier of the AWS account that owns the EC2 VPC.
- filters
GetVpc Attachment Filter[] 
- appliance_mode_ strsupport 
- Whether Appliance Mode support is enabled.
- arn str
- ARN of the attachment.
- dns_support str
- Whether DNS support is enabled.
- id str
- EC2 Transit Gateway VPC Attachment identifier
- ipv6_support str
- Whether IPv6 support is enabled.
- security_group_ strreferencing_ support 
- Whether Security Group Referencing Support is enabled.
- subnet_ids Sequence[str]
- Identifiers of EC2 Subnets.
- Mapping[str, str]
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- transit_gateway_ strid 
- EC2 Transit Gateway identifier
- vpc_id str
- Identifier of EC2 VPC.
- vpc_owner_ strid 
- Identifier of the AWS account that owns the EC2 VPC.
- filters
Sequence[GetVpc Attachment Filter] 
- applianceMode StringSupport 
- Whether Appliance Mode support is enabled.
- arn String
- ARN of the attachment.
- dnsSupport String
- Whether DNS support is enabled.
- id String
- EC2 Transit Gateway VPC Attachment identifier
- ipv6Support String
- Whether IPv6 support is enabled.
- securityGroup StringReferencing Support 
- Whether Security Group Referencing Support is enabled.
- subnetIds List<String>
- Identifiers of EC2 Subnets.
- Map<String>
- Key-value tags for the EC2 Transit Gateway VPC Attachment
- transitGateway StringId 
- EC2 Transit Gateway identifier
- vpcId String
- Identifier of EC2 VPC.
- vpcOwner StringId 
- Identifier of the AWS account that owns the EC2 VPC.
- filters List<Property Map>
Supporting Types
GetVpcAttachmentFilter   
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.