1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2transitgateway
  5. getVpcAttachment

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.37.1 published on Friday, May 24, 2024 by Pulumi

aws.ec2transitgateway.getVpcAttachment

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.37.1 published on Friday, May 24, 2024 by Pulumi

    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=[aws.ec2transitgateway.GetVpcAttachmentFilterArgs(
        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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2transitgateway/getVpcAttachment:getVpcAttachment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetVpcAttachmentFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    Id string
    Identifier of the EC2 Transit Gateway VPC Attachment.
    Tags Dictionary<string, string>
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    Filters []GetVpcAttachmentFilter
    One or more configuration blocks containing name-values filters. Detailed below.
    Id string
    Identifier of the EC2 Transit Gateway VPC Attachment.
    Tags map[string]string
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    filters List<GetVpcAttachmentFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    id String
    Identifier of the EC2 Transit Gateway VPC Attachment.
    tags Map<String,String>
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    filters GetVpcAttachmentFilter[]
    One or more configuration blocks containing name-values filters. Detailed below.
    id string
    Identifier of the EC2 Transit Gateway VPC Attachment.
    tags {[key: string]: string}
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    filters Sequence[GetVpcAttachmentFilter]
    One or more configuration blocks containing name-values filters. Detailed below.
    id str
    Identifier of the EC2 Transit Gateway VPC Attachment.
    tags 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.
    tags Map<String>
    Key-value tags for the EC2 Transit Gateway VPC Attachment

    getVpcAttachment Result

    The following output properties are available:

    ApplianceModeSupport string
    Whether Appliance Mode support is enabled.
    DnsSupport string
    Whether DNS support is enabled.
    Id string
    EC2 Transit Gateway VPC Attachment identifier
    Ipv6Support string
    Whether IPv6 support is enabled.
    SubnetIds List<string>
    Identifiers of EC2 Subnets.
    Tags Dictionary<string, string>
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    TransitGatewayId string
    EC2 Transit Gateway identifier
    VpcId string
    Identifier of EC2 VPC.
    VpcOwnerId string
    Identifier of the AWS account that owns the EC2 VPC.
    Filters List<GetVpcAttachmentFilter>
    ApplianceModeSupport string
    Whether Appliance Mode support is enabled.
    DnsSupport string
    Whether DNS support is enabled.
    Id string
    EC2 Transit Gateway VPC Attachment identifier
    Ipv6Support string
    Whether IPv6 support is enabled.
    SubnetIds []string
    Identifiers of EC2 Subnets.
    Tags map[string]string
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    TransitGatewayId string
    EC2 Transit Gateway identifier
    VpcId string
    Identifier of EC2 VPC.
    VpcOwnerId string
    Identifier of the AWS account that owns the EC2 VPC.
    Filters []GetVpcAttachmentFilter
    applianceModeSupport String
    Whether Appliance Mode support is enabled.
    dnsSupport String
    Whether DNS support is enabled.
    id String
    EC2 Transit Gateway VPC Attachment identifier
    ipv6Support String
    Whether IPv6 support is enabled.
    subnetIds List<String>
    Identifiers of EC2 Subnets.
    tags Map<String,String>
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    transitGatewayId String
    EC2 Transit Gateway identifier
    vpcId String
    Identifier of EC2 VPC.
    vpcOwnerId String
    Identifier of the AWS account that owns the EC2 VPC.
    filters List<GetVpcAttachmentFilter>
    applianceModeSupport string
    Whether Appliance Mode support is enabled.
    dnsSupport string
    Whether DNS support is enabled.
    id string
    EC2 Transit Gateway VPC Attachment identifier
    ipv6Support string
    Whether IPv6 support is enabled.
    subnetIds string[]
    Identifiers of EC2 Subnets.
    tags {[key: string]: string}
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    transitGatewayId string
    EC2 Transit Gateway identifier
    vpcId string
    Identifier of EC2 VPC.
    vpcOwnerId string
    Identifier of the AWS account that owns the EC2 VPC.
    filters GetVpcAttachmentFilter[]
    appliance_mode_support str
    Whether Appliance Mode support is enabled.
    dns_support str
    Whether DNS support is enabled.
    id str
    EC2 Transit Gateway VPC Attachment identifier
    ipv6_support str
    Whether IPv6 support is enabled.
    subnet_ids Sequence[str]
    Identifiers of EC2 Subnets.
    tags Mapping[str, str]
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    transit_gateway_id str
    EC2 Transit Gateway identifier
    vpc_id str
    Identifier of EC2 VPC.
    vpc_owner_id str
    Identifier of the AWS account that owns the EC2 VPC.
    filters Sequence[GetVpcAttachmentFilter]
    applianceModeSupport String
    Whether Appliance Mode support is enabled.
    dnsSupport String
    Whether DNS support is enabled.
    id String
    EC2 Transit Gateway VPC Attachment identifier
    ipv6Support String
    Whether IPv6 support is enabled.
    subnetIds List<String>
    Identifiers of EC2 Subnets.
    tags Map<String>
    Key-value tags for the EC2 Transit Gateway VPC Attachment
    transitGatewayId String
    EC2 Transit Gateway identifier
    vpcId String
    Identifier of EC2 VPC.
    vpcOwnerId String
    Identifier of the AWS account that owns the EC2 VPC.
    filters List<Property Map>

    Supporting Types

    GetVpcAttachmentFilter

    Name string
    Name of the filter.
    Values List<string>
    List of one or more values for the filter.
    Name string
    Name of the filter.
    Values []string
    List of one or more values for the filter.
    name String
    Name of the filter.
    values List<String>
    List of one or more values for the filter.
    name string
    Name of the filter.
    values string[]
    List of one or more values for the filter.
    name str
    Name of the filter.
    values Sequence[str]
    List of one or more values for the filter.
    name String
    Name of the filter.
    values List<String>
    List of one or more values for the filter.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.37.1 published on Friday, May 24, 2024 by Pulumi