AWS v6.71.0 published on Friday, Mar 7, 2025 by Pulumi
aws.ec2transitgateway.getAttachments
Explore with Pulumi AI
Get information on EC2 Transit Gateway Attachments.
Example Usage
By Filter
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const filtered = aws.ec2transitgateway.getAttachments({
    filters: [
        {
            name: "state",
            values: ["pendingAcceptance"],
        },
        {
            name: "resource-type",
            values: ["vpc"],
        },
    ],
});
const unit = .map(__index => (aws.ec2transitgateway.getAttachment({
    transitGatewayAttachmentId: _arg0_.ids[__index],
})));
import pulumi
import pulumi_aws as aws
filtered = aws.ec2transitgateway.get_attachments(filters=[
    {
        "name": "state",
        "values": ["pendingAcceptance"],
    },
    {
        "name": "resource-type",
        "values": ["vpc"],
    },
])
unit = [aws.ec2transitgateway.get_attachment(transit_gateway_attachment_id=filtered.ids[__index]) for __index in range(len(filtered.ids))]
Coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var filtered = Aws.Ec2TransitGateway.GetAttachments.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2TransitGateway.Inputs.GetAttachmentsFilterInputArgs
            {
                Name = "state",
                Values = new[]
                {
                    "pendingAcceptance",
                },
            },
            new Aws.Ec2TransitGateway.Inputs.GetAttachmentsFilterInputArgs
            {
                Name = "resource-type",
                Values = new[]
                {
                    "vpc",
                },
            },
        },
    });
    var unit = ;
});
Coming soon!
Coming soon!
Using getAttachments
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 getAttachments(args: GetAttachmentsArgs, opts?: InvokeOptions): Promise<GetAttachmentsResult>
function getAttachmentsOutput(args: GetAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetAttachmentsResult>def get_attachments(filters: Optional[Sequence[GetAttachmentsFilter]] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAttachmentsResult
def get_attachments_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetAttachmentsFilterArgs]]]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAttachmentsResult]func GetAttachments(ctx *Context, args *GetAttachmentsArgs, opts ...InvokeOption) (*GetAttachmentsResult, error)
func GetAttachmentsOutput(ctx *Context, args *GetAttachmentsOutputArgs, opts ...InvokeOption) GetAttachmentsResultOutput> Note: This function is named GetAttachments in the Go SDK.
public static class GetAttachments 
{
    public static Task<GetAttachmentsResult> InvokeAsync(GetAttachmentsArgs args, InvokeOptions? opts = null)
    public static Output<GetAttachmentsResult> Invoke(GetAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAttachmentsResult> getAttachments(GetAttachmentsArgs args, InvokeOptions options)
public static Output<GetAttachmentsResult> getAttachments(GetAttachmentsArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2transitgateway/getAttachments:getAttachments
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Filters
List<GetAttachments Filter> 
- One or more configuration blocks containing name-values filters. Detailed below.
- Dictionary<string, string>
- Filters
[]GetAttachments Filter 
- One or more configuration blocks containing name-values filters. Detailed below.
- map[string]string
- filters
List<GetAttachments Filter> 
- One or more configuration blocks containing name-values filters. Detailed below.
- Map<String,String>
- filters
GetAttachments Filter[] 
- One or more configuration blocks containing name-values filters. Detailed below.
- {[key: string]: string}
- filters
Sequence[GetAttachments Filter] 
- One or more configuration blocks containing name-values filters. Detailed below.
- Mapping[str, str]
- filters List<Property Map>
- One or more configuration blocks containing name-values filters. Detailed below.
- Map<String>
getAttachments 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.getAttachment][2] data source, searching by identifier.
- Dictionary<string, string>
- Filters
List<GetAttachments Filter> 
- 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.getAttachment][2] data source, searching by identifier.
- map[string]string
- Filters
[]GetAttachments Filter 
- 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.getAttachment][2] data source, searching by identifier.
- Map<String,String>
- filters
List<GetAttachments Filter> 
- 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.getAttachment][2] data source, searching by identifier.
- {[key: string]: string}
- filters
GetAttachments Filter[] 
- 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.getAttachment][2] data source, searching by identifier.
- Mapping[str, str]
- filters
Sequence[GetAttachments Filter] 
- 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.getAttachment][2] data source, searching by identifier.
- Map<String>
- filters List<Property Map>
Supporting Types
GetAttachmentsFilter  
- Name string
- Name of the filter check available value on official documentation
- Values List<string>
- List of one or more values for the filter.
- Name string
- Name of the filter check available value on official documentation
- Values []string
- List of one or more values for the filter.
- name String
- Name of the filter check available value on official documentation
- values List<String>
- List of one or more values for the filter.
- name string
- Name of the filter check available value on official documentation
- values string[]
- List of one or more values for the filter.
- name str
- Name of the filter check available value on official documentation
- values Sequence[str]
- List of one or more values for the filter.
- name String
- Name of the filter check available value on official documentation
- 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 awsTerraform Provider.