1. Packages
  2. AWS
  3. API Docs
  4. ec2transitgateway
  5. getVpcAttachments
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.ec2transitgateway.getVpcAttachments

Explore with Pulumi AI

Get information on EC2 Transit Gateway VPC Attachments.

Example Usage

By Filter

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const filtered = aws.ec2transitgateway.getVpcAttachments({
    filters: [{
        name: "state",
        values: ["pendingAcceptance"],
    }],
});
const unit = .map(__index => (aws.ec2transitgateway.getVpcAttachment({
    id: _arg0_.ids[__index],
})));
Copy
import pulumi
import pulumi_aws as aws

filtered = aws.ec2transitgateway.get_vpc_attachments(filters=[{
    "name": "state",
    "values": ["pendingAcceptance"],
}])
unit = [aws.ec2transitgateway.get_vpc_attachment(id=filtered.ids[__index]) for __index in range(len(filtered.ids))]
Copy
Coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var filtered = Aws.Ec2TransitGateway.GetVpcAttachments.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2TransitGateway.Inputs.GetVpcAttachmentsFilterInputArgs
            {
                Name = "state",
                Values = new[]
                {
                    "pendingAcceptance",
                },
            },
        },
    });

    var unit = ;

});
Copy
Coming soon!
Coming soon!

Using getVpcAttachments

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 getVpcAttachments(args: GetVpcAttachmentsArgs, opts?: InvokeOptions): Promise<GetVpcAttachmentsResult>
function getVpcAttachmentsOutput(args: GetVpcAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetVpcAttachmentsResult>
Copy
def get_vpc_attachments(filters: Optional[Sequence[GetVpcAttachmentsFilter]] = None,
                        opts: Optional[InvokeOptions] = None) -> GetVpcAttachmentsResult
def get_vpc_attachments_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcAttachmentsFilterArgs]]]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetVpcAttachmentsResult]
Copy
func GetVpcAttachments(ctx *Context, args *GetVpcAttachmentsArgs, opts ...InvokeOption) (*GetVpcAttachmentsResult, error)
func GetVpcAttachmentsOutput(ctx *Context, args *GetVpcAttachmentsOutputArgs, opts ...InvokeOption) GetVpcAttachmentsResultOutput
Copy

> Note: This function is named GetVpcAttachments in the Go SDK.

public static class GetVpcAttachments 
{
    public static Task<GetVpcAttachmentsResult> InvokeAsync(GetVpcAttachmentsArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcAttachmentsResult> Invoke(GetVpcAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVpcAttachmentsResult> getVpcAttachments(GetVpcAttachmentsArgs args, InvokeOptions options)
public static Output<GetVpcAttachmentsResult> getVpcAttachments(GetVpcAttachmentsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:ec2transitgateway/getVpcAttachments:getVpcAttachments
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters List<GetVpcAttachmentsFilter>
One or more configuration blocks containing name-values filters. Detailed below.
Filters []GetVpcAttachmentsFilter
One or more configuration blocks containing name-values filters. Detailed below.
filters List<GetVpcAttachmentsFilter>
One or more configuration blocks containing name-values filters. Detailed below.
filters GetVpcAttachmentsFilter[]
One or more configuration blocks containing name-values filters. Detailed below.
filters Sequence[GetVpcAttachmentsFilter]
One or more configuration blocks containing name-values filters. Detailed below.
filters List<Property Map>
One or more configuration blocks containing name-values filters. Detailed below.

getVpcAttachments Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [aws.ec2transitgateway.VpcAttachment][2] data source, searching by identifier.
Filters List<GetVpcAttachmentsFilter>
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [aws.ec2transitgateway.VpcAttachment][2] data source, searching by identifier.
Filters []GetVpcAttachmentsFilter
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [aws.ec2transitgateway.VpcAttachment][2] data source, searching by identifier.
filters List<GetVpcAttachmentsFilter>
id string
The provider-assigned unique ID for this managed resource.
ids string[]
A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [aws.ec2transitgateway.VpcAttachment][2] data source, searching by identifier.
filters GetVpcAttachmentsFilter[]
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [aws.ec2transitgateway.VpcAttachment][2] data source, searching by identifier.
filters Sequence[GetVpcAttachmentsFilter]
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of all attachments ids matching the filter. You can retrieve more information about the attachment using the [aws.ec2transitgateway.VpcAttachment][2] data source, searching by identifier.
filters List<Property Map>

Supporting Types

GetVpcAttachmentsFilter

Name This property is required. string
Name of the filter check available value on official documentation
Values This property is required. List<string>
List of one or more values for the filter.
Name This property is required. string
Name of the filter check available value on official documentation
Values This property is required. []string
List of one or more values for the filter.
name This property is required. String
Name of the filter check available value on official documentation
values This property is required. List<String>
List of one or more values for the filter.
name This property is required. string
Name of the filter check available value on official documentation
values This property is required. string[]
List of one or more values for the filter.
name This property is required. str
Name of the filter check available value on official documentation
values This property is required. Sequence[str]
List of one or more values for the filter.
name This property is required. String
Name of the filter check available value on official documentation
values This property is required. 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.