AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.6.0 published on Friday, May 27, 2022 by Pulumi

getPeeringAttachment

Get information on an EC2 Transit Gateway Peering Attachment.

Example Usage

By Filter

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.Ec2TransitGateway.GetPeeringAttachment.InvokeAsync(new Aws.Ec2TransitGateway.GetPeeringAttachmentArgs
        {
            Filters = 
            {
                new Aws.Ec2TransitGateway.Inputs.GetPeeringAttachmentFilterArgs
                {
                    Name = "transit-gateway-attachment-id",
                    Values = 
                    {
                        "tgw-attach-12345678",
                    },
                },
            },
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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{
				ec2transitgateway.GetPeeringAttachmentFilter{
					Name: "transit-gateway-attachment-id",
					Values: []string{
						"tgw-attach-12345678",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(Ec2transitgatewayFunctions.getPeeringAttachment(GetPeeringAttachmentArgs.builder()
            .filters(GetPeeringAttachmentFilterArgs.builder()
                .name("transit-gateway-attachment-id")
                .values("tgw-attach-12345678")
                .build())
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.get_peering_attachment(filters=[aws.ec2transitgateway.GetPeeringAttachmentFilterArgs(
    name="transit-gateway-attachment-id",
    values=["tgw-attach-12345678"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.ec2transitgateway.getPeeringAttachment({
    filters: [{
        name: "transit-gateway-attachment-id",
        values: ["tgw-attach-12345678"],
    }],
}));
variables:
  example:
    Fn::Invoke:
      Function: aws:ec2transitgateway:getPeeringAttachment
      Arguments:
        filters:
          - name: transit-gateway-attachment-id
            values:
              - tgw-attach-12345678

By Identifier

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var attachment = Output.Create(Aws.Ec2TransitGateway.GetPeeringAttachment.InvokeAsync(new Aws.Ec2TransitGateway.GetPeeringAttachmentArgs
        {
            Id = "tgw-attach-12345678",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var attachment = Output.of(Ec2transitgatewayFunctions.getPeeringAttachment(GetPeeringAttachmentArgs.builder()
            .id("tgw-attach-12345678")
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

attachment = aws.ec2transitgateway.get_peering_attachment(id="tgw-attach-12345678")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const attachment = pulumi.output(aws.ec2transitgateway.getPeeringAttachment({
    id: "tgw-attach-12345678",
}));
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>

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

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

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

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>

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

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}

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

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]

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

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>

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

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

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

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

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

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

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

tags Map<String>
transitGatewayId String

Identifier of the local EC2 Transit Gateway

filters List<Property Map>

Supporting Types

GetPeeringAttachmentFilter

Name string

The 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

The 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

The 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

The 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

The 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

The 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
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.