1. Packages
  2. AWS
  3. API Docs
  4. ec2transitgateway
  5. getPeeringAttachment
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.ec2transitgateway.getPeeringAttachment

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Get information on an EC2 Transit Gateway Peering Attachment.

    Example Usage

    By Filter

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ec2transitgateway.getPeeringAttachment({
        filters: [{
            name: "transit-gateway-attachment-id",
            values: ["tgw-attach-12345678"],
        }],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2transitgateway.get_peering_attachment(filters=[{
        "name": "transit-gateway-attachment-id",
        "values": ["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.LookupPeeringAttachment(ctx, &ec2transitgateway.LookupPeeringAttachmentArgs{
    			Filters: []ec2transitgateway.GetPeeringAttachmentFilter{
    				{
    					Name: "transit-gateway-attachment-id",
    					Values: []string{
    						"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.GetPeeringAttachment.Invoke(new()
        {
            Filters = new[]
            {
                new Aws.Ec2TransitGateway.Inputs.GetPeeringAttachmentFilterInputArgs
                {
                    Name = "transit-gateway-attachment-id",
                    Values = new[]
                    {
                        "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.GetPeeringAttachmentArgs;
    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.getPeeringAttachment(GetPeeringAttachmentArgs.builder()
                .filters(GetPeeringAttachmentFilterArgs.builder()
                    .name("transit-gateway-attachment-id")
                    .values("tgw-attach-12345678")
                    .build())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:ec2transitgateway:getPeeringAttachment
          Arguments:
            filters:
              - name: transit-gateway-attachment-id
                values:
                  - tgw-attach-12345678
    

    By Identifier

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const attachment = aws.ec2transitgateway.getPeeringAttachment({
        id: "tgw-attach-12345678",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    attachment = aws.ec2transitgateway.get_peering_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.LookupPeeringAttachment(ctx, &ec2transitgateway.LookupPeeringAttachmentArgs{
    			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 attachment = Aws.Ec2TransitGateway.GetPeeringAttachment.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.GetPeeringAttachmentArgs;
    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 attachment = Ec2transitgatewayFunctions.getPeeringAttachment(GetPeeringAttachmentArgs.builder()
                .id("tgw-attach-12345678")
                .build());
    
        }
    }
    
    variables:
      attachment:
        fn::invoke:
          Function: aws:ec2transitgateway:getPeeringAttachment
          Arguments:
            id: tgw-attach-12345678
    

    Using getPeeringAttachment

    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 getPeeringAttachment(args: GetPeeringAttachmentArgs, opts?: InvokeOptions): Promise<GetPeeringAttachmentResult>
    function getPeeringAttachmentOutput(args: GetPeeringAttachmentOutputArgs, opts?: InvokeOptions): Output<GetPeeringAttachmentResult>
    def get_peering_attachment(filters: Optional[Sequence[GetPeeringAttachmentFilter]] = None,
                               id: Optional[str] = None,
                               tags: Optional[Mapping[str, str]] = None,
                               opts: Optional[InvokeOptions] = None) -> GetPeeringAttachmentResult
    def get_peering_attachment_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetPeeringAttachmentFilterArgs]]]] = None,
                               id: Optional[pulumi.Input[str]] = None,
                               tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetPeeringAttachmentResult]
    func LookupPeeringAttachment(ctx *Context, args *LookupPeeringAttachmentArgs, opts ...InvokeOption) (*LookupPeeringAttachmentResult, error)
    func LookupPeeringAttachmentOutput(ctx *Context, args *LookupPeeringAttachmentOutputArgs, opts ...InvokeOption) LookupPeeringAttachmentResultOutput

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

    public static class GetPeeringAttachment 
    {
        public static Task<GetPeeringAttachmentResult> InvokeAsync(GetPeeringAttachmentArgs args, InvokeOptions? opts = null)
        public static Output<GetPeeringAttachmentResult> Invoke(GetPeeringAttachmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPeeringAttachmentResult> getPeeringAttachment(GetPeeringAttachmentArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2transitgateway/getPeeringAttachment:getPeeringAttachment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetPeeringAttachmentFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    Id string
    Identifier of the EC2 Transit Gateway Peering Attachment.
    Tags Dictionary<string, string>

    Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    Filters []GetPeeringAttachmentFilter
    One or more configuration blocks containing name-values filters. Detailed below.
    Id string
    Identifier of the EC2 Transit Gateway Peering Attachment.
    Tags map[string]string

    Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters List<GetPeeringAttachmentFilter>
    One or more configuration blocks containing name-values filters. Detailed below.
    id String
    Identifier of the EC2 Transit Gateway Peering Attachment.
    tags Map<String,String>

    Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters GetPeeringAttachmentFilter[]
    One or more configuration blocks containing name-values filters. Detailed below.
    id string
    Identifier of the EC2 Transit Gateway Peering Attachment.
    tags {[key: string]: string}

    Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters Sequence[GetPeeringAttachmentFilter]
    One or more configuration blocks containing name-values filters. Detailed below.
    id str
    Identifier of the EC2 Transit Gateway Peering Attachment.
    tags Mapping[str, str]

    Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    filters List<Property Map>
    One or more configuration blocks containing name-values filters. Detailed below.
    id String
    Identifier of the EC2 Transit Gateway Peering Attachment.
    tags Map<String>

    Mapping of tags, each pair of which must exactly match a pair on the specific EC2 Transit Gateway Peering Attachment to retrieve.

    More complex filters can be expressed using one or more filter sub-blocks, which take the following arguments:

    getPeeringAttachment Result

    The following output properties are available:

    Id string
    PeerAccountId string
    Identifier of the peer AWS account
    PeerRegion string
    Identifier of the peer AWS region
    PeerTransitGatewayId string
    Identifier of the peer EC2 Transit Gateway
    State string
    Tags Dictionary<string, string>
    TransitGatewayId string
    Identifier of the local EC2 Transit Gateway
    Filters List<GetPeeringAttachmentFilter>
    Id string
    PeerAccountId string
    Identifier of the peer AWS account
    PeerRegion string
    Identifier of the peer AWS region
    PeerTransitGatewayId string
    Identifier of the peer EC2 Transit Gateway
    State string
    Tags map[string]string
    TransitGatewayId string
    Identifier of the local EC2 Transit Gateway
    Filters []GetPeeringAttachmentFilter
    id String
    peerAccountId String
    Identifier of the peer AWS account
    peerRegion String
    Identifier of the peer AWS region
    peerTransitGatewayId String
    Identifier of the peer EC2 Transit Gateway
    state String
    tags Map<String,String>
    transitGatewayId String
    Identifier of the local EC2 Transit Gateway
    filters List<GetPeeringAttachmentFilter>
    id string
    peerAccountId string
    Identifier of the peer AWS account
    peerRegion string
    Identifier of the peer AWS region
    peerTransitGatewayId string
    Identifier of the peer EC2 Transit Gateway
    state string
    tags {[key: string]: string}
    transitGatewayId string
    Identifier of the local EC2 Transit Gateway
    filters GetPeeringAttachmentFilter[]
    id str
    peer_account_id str
    Identifier of the peer AWS account
    peer_region str
    Identifier of the peer AWS region
    peer_transit_gateway_id str
    Identifier of the peer EC2 Transit Gateway
    state str
    tags Mapping[str, str]
    transit_gateway_id str
    Identifier of the local EC2 Transit Gateway
    filters Sequence[GetPeeringAttachmentFilter]
    id String
    peerAccountId String
    Identifier of the peer AWS account
    peerRegion String
    Identifier of the peer AWS region
    peerTransitGatewayId String
    Identifier of the peer EC2 Transit Gateway
    state String
    tags Map<String>
    transitGatewayId String
    Identifier of the local EC2 Transit Gateway
    filters List<Property Map>

    Supporting Types

    GetPeeringAttachmentFilter

    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values List<string>
    Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
    Name string
    Name of the field to filter by, as defined by the underlying AWS API.
    Values []string
    Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
    name string
    Name of the field to filter by, as defined by the underlying AWS API.
    values string[]
    Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
    name str
    Name of the field to filter by, as defined by the underlying AWS API.
    values Sequence[str]
    Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.
    name String
    Name of the field to filter by, as defined by the underlying AWS API.
    values List<String>
    Set of values that are accepted for the given field. An EC2 Transit Gateway Peering Attachment be selected if any one of the given values matches.

    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
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi