1. Packages
  2. AWS
  3. API Docs
  4. ec2transitgateway
  5. getPeeringAttachments
AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi
aws-v6 logo
AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi

    Get information on EC2 Transit Gateway Peering Attachments.

    Example Usage

    All Resources

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const test = aws.ec2transitgateway.getPeeringAttachments({});
    
    import pulumi
    import pulumi_aws as aws
    
    test = aws.ec2transitgateway.get_peering_attachments()
    
    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.GetPeeringAttachments(ctx, &ec2transitgateway.GetPeeringAttachmentsArgs{}, 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.GetPeeringAttachments.Invoke();
    
    });
    
    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.GetPeeringAttachmentsArgs;
    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.getPeeringAttachments(GetPeeringAttachmentsArgs.builder()
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          function: aws:ec2transitgateway:getPeeringAttachments
          arguments: {}
    

    By Filter

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const filtered = aws.ec2transitgateway.getPeeringAttachments({
        filters: [{
            name: "state",
            values: ["pendingAcceptance"],
        }],
    });
    const unit = .map(__index => (aws.ec2transitgateway.getPeeringAttachment({
        id: _arg0_.ids[__index],
    })));
    
    import pulumi
    import pulumi_aws as aws
    
    filtered = aws.ec2transitgateway.get_peering_attachments(filters=[{
        "name": "state",
        "values": ["pendingAcceptance"],
    }])
    unit = [aws.ec2transitgateway.get_peering_attachment(id=filtered.ids[__index]) for __index in len(filtered.ids).apply(lambda length: range(length))]
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var filtered = Aws.Ec2TransitGateway.GetPeeringAttachments.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2TransitGateway.Inputs.GetPeeringAttachmentsFilterInputArgs
                {
                    Name = "state",
                    Values = new[]
                    {
                        "pendingAcceptance",
                    },
                },
            },
        });
    
        var unit = ;
    
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Using getPeeringAttachments

    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 getPeeringAttachments(args: GetPeeringAttachmentsArgs, opts?: InvokeOptions): Promise<GetPeeringAttachmentsResult>
    function getPeeringAttachmentsOutput(args: GetPeeringAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetPeeringAttachmentsResult>
    def get_peering_attachments(filters: Optional[Sequence[GetPeeringAttachmentsFilter]] = None,
                                opts: Optional[InvokeOptions] = None) -> GetPeeringAttachmentsResult
    def get_peering_attachments_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetPeeringAttachmentsFilterArgs]]]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetPeeringAttachmentsResult]
    func GetPeeringAttachments(ctx *Context, args *GetPeeringAttachmentsArgs, opts ...InvokeOption) (*GetPeeringAttachmentsResult, error)
    func GetPeeringAttachmentsOutput(ctx *Context, args *GetPeeringAttachmentsOutputArgs, opts ...InvokeOption) GetPeeringAttachmentsResultOutput

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

    public static class GetPeeringAttachments 
    {
        public static Task<GetPeeringAttachmentsResult> InvokeAsync(GetPeeringAttachmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetPeeringAttachmentsResult> Invoke(GetPeeringAttachmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPeeringAttachmentsResult> getPeeringAttachments(GetPeeringAttachmentsArgs args, InvokeOptions options)
    public static Output<GetPeeringAttachmentsResult> getPeeringAttachments(GetPeeringAttachmentsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:ec2transitgateway/getPeeringAttachments:getPeeringAttachments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetPeeringAttachmentsFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    Filters []GetPeeringAttachmentsFilter
    One or more configuration blocks containing name-values filters. Detailed below.
    filters List<GetPeeringAttachmentsFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    filters GetPeeringAttachmentsFilter[]
    One or more configuration blocks containing name-values filters. Detailed below.
    filters Sequence[GetPeeringAttachmentsFilter]
    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.

    getPeeringAttachments 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.PeeringAttachment][2] data source, searching by identifier.
    Filters List<GetPeeringAttachmentsFilter>
    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.PeeringAttachment][2] data source, searching by identifier.
    Filters []GetPeeringAttachmentsFilter
    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.PeeringAttachment][2] data source, searching by identifier.
    filters List<GetPeeringAttachmentsFilter>
    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.PeeringAttachment][2] data source, searching by identifier.
    filters GetPeeringAttachmentsFilter[]
    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.PeeringAttachment][2] data source, searching by identifier.
    filters Sequence[GetPeeringAttachmentsFilter]
    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.PeeringAttachment][2] data source, searching by identifier.
    filters List<Property Map>

    Supporting Types

    GetPeeringAttachmentsFilter

    Name string
    Name of the field to filter by, as defined by the underlying AWS API
    Values List<string>
    List of one or more values for the filter.
    Name string
    Name of the field to filter by, as defined by the underlying AWS API
    Values []string
    List of one or more values for the filter.
    name String
    Name of the field to filter by, as defined by the underlying AWS API
    values List<String>
    List of one or more values for the filter.
    name string
    Name of the field to filter by, as defined by the underlying AWS API
    values string[]
    List of one or more values for the filter.
    name str
    Name of the field to filter by, as defined by the underlying AWS API
    values Sequence[str]
    List of one or more values for the filter.
    name String
    Name of the field to filter by, as defined by the underlying AWS API
    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-v6 logo
    AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate