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

aws.ec2transitgateway.getConnectPeer

Explore with Pulumi AI

Get information on an EC2 Transit Gateway Connect Peer.

Example Usage

By Filter

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

const example = aws.ec2transitgateway.getConnectPeer({
    filters: [{
        name: "transit-gateway-attachment-id",
        values: ["tgw-attach-12345678"],
    }],
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.get_connect_peer(filters=[{
    "name": "transit-gateway-attachment-id",
    "values": ["tgw-attach-12345678"],
}])
Copy
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.LookupConnectPeer(ctx, &ec2transitgateway.LookupConnectPeerArgs{
			Filters: []ec2transitgateway.GetConnectPeerFilter{
				{
					Name: "transit-gateway-attachment-id",
					Values: []string{
						"tgw-attach-12345678",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Ec2TransitGateway.GetConnectPeer.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2TransitGateway.Inputs.GetConnectPeerFilterInputArgs
            {
                Name = "transit-gateway-attachment-id",
                Values = new[]
                {
                    "tgw-attach-12345678",
                },
            },
        },
    });

});
Copy
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.GetConnectPeerArgs;
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.getConnectPeer(GetConnectPeerArgs.builder()
            .filters(GetConnectPeerFilterArgs.builder()
                .name("transit-gateway-attachment-id")
                .values("tgw-attach-12345678")
                .build())
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:ec2transitgateway:getConnectPeer
      arguments:
        filters:
          - name: transit-gateway-attachment-id
            values:
              - tgw-attach-12345678
Copy

By Identifier

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

const example = aws.ec2transitgateway.getConnectPeer({
    transitGatewayConnectPeerId: "tgw-connect-peer-12345678",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.get_connect_peer(transit_gateway_connect_peer_id="tgw-connect-peer-12345678")
Copy
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.LookupConnectPeer(ctx, &ec2transitgateway.LookupConnectPeerArgs{
			TransitGatewayConnectPeerId: pulumi.StringRef("tgw-connect-peer-12345678"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Ec2TransitGateway.GetConnectPeer.Invoke(new()
    {
        TransitGatewayConnectPeerId = "tgw-connect-peer-12345678",
    });

});
Copy
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.GetConnectPeerArgs;
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.getConnectPeer(GetConnectPeerArgs.builder()
            .transitGatewayConnectPeerId("tgw-connect-peer-12345678")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:ec2transitgateway:getConnectPeer
      arguments:
        transitGatewayConnectPeerId: tgw-connect-peer-12345678
Copy

Using getConnectPeer

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 getConnectPeer(args: GetConnectPeerArgs, opts?: InvokeOptions): Promise<GetConnectPeerResult>
function getConnectPeerOutput(args: GetConnectPeerOutputArgs, opts?: InvokeOptions): Output<GetConnectPeerResult>
Copy
def get_connect_peer(filters: Optional[Sequence[GetConnectPeerFilter]] = None,
                     tags: Optional[Mapping[str, str]] = None,
                     transit_gateway_connect_peer_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetConnectPeerResult
def get_connect_peer_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetConnectPeerFilterArgs]]]] = None,
                     tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                     transit_gateway_connect_peer_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetConnectPeerResult]
Copy
func LookupConnectPeer(ctx *Context, args *LookupConnectPeerArgs, opts ...InvokeOption) (*LookupConnectPeerResult, error)
func LookupConnectPeerOutput(ctx *Context, args *LookupConnectPeerOutputArgs, opts ...InvokeOption) LookupConnectPeerResultOutput
Copy

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

public static class GetConnectPeer 
{
    public static Task<GetConnectPeerResult> InvokeAsync(GetConnectPeerArgs args, InvokeOptions? opts = null)
    public static Output<GetConnectPeerResult> Invoke(GetConnectPeerInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetConnectPeerResult> getConnectPeer(GetConnectPeerArgs args, InvokeOptions options)
public static Output<GetConnectPeerResult> getConnectPeer(GetConnectPeerArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:ec2transitgateway/getConnectPeer:getConnectPeer
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters List<GetConnectPeerFilter>
One or more configuration blocks containing name-values filters. Detailed below.
Tags Dictionary<string, string>
Key-value tags for the EC2 Transit Gateway Connect Peer
TransitGatewayConnectPeerId string
Identifier of the EC2 Transit Gateway Connect Peer.
Filters []GetConnectPeerFilter
One or more configuration blocks containing name-values filters. Detailed below.
Tags map[string]string
Key-value tags for the EC2 Transit Gateway Connect Peer
TransitGatewayConnectPeerId string
Identifier of the EC2 Transit Gateway Connect Peer.
filters List<GetConnectPeerFilter>
One or more configuration blocks containing name-values filters. Detailed below.
tags Map<String,String>
Key-value tags for the EC2 Transit Gateway Connect Peer
transitGatewayConnectPeerId String
Identifier of the EC2 Transit Gateway Connect Peer.
filters GetConnectPeerFilter[]
One or more configuration blocks containing name-values filters. Detailed below.
tags {[key: string]: string}
Key-value tags for the EC2 Transit Gateway Connect Peer
transitGatewayConnectPeerId string
Identifier of the EC2 Transit Gateway Connect Peer.
filters Sequence[GetConnectPeerFilter]
One or more configuration blocks containing name-values filters. Detailed below.
tags Mapping[str, str]
Key-value tags for the EC2 Transit Gateway Connect Peer
transit_gateway_connect_peer_id str
Identifier of the EC2 Transit Gateway Connect Peer.
filters List<Property Map>
One or more configuration blocks containing name-values filters. Detailed below.
tags Map<String>
Key-value tags for the EC2 Transit Gateway Connect Peer
transitGatewayConnectPeerId String
Identifier of the EC2 Transit Gateway Connect Peer.

getConnectPeer Result

The following output properties are available:

Arn string
EC2 Transit Gateway Connect Peer ARN
BgpAsn string
BGP ASN number assigned customer device
BgpPeerAddress string
The IP address assigned to customer device, which is used as BGP IP address.
BgpTransitGatewayAddresses List<string>
The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
Id string
The provider-assigned unique ID for this managed resource.
InsideCidrBlocks List<string>
CIDR blocks that will be used for addressing within the tunnel.
PeerAddress string
IP addressed assigned to customer device, which is used as tunnel endpoint
Tags Dictionary<string, string>
Key-value tags for the EC2 Transit Gateway Connect Peer
TransitGatewayAddress string
The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
TransitGatewayAttachmentId string
The Transit Gateway Connect
TransitGatewayConnectPeerId string
Filters List<GetConnectPeerFilter>
Arn string
EC2 Transit Gateway Connect Peer ARN
BgpAsn string
BGP ASN number assigned customer device
BgpPeerAddress string
The IP address assigned to customer device, which is used as BGP IP address.
BgpTransitGatewayAddresses []string
The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
Id string
The provider-assigned unique ID for this managed resource.
InsideCidrBlocks []string
CIDR blocks that will be used for addressing within the tunnel.
PeerAddress string
IP addressed assigned to customer device, which is used as tunnel endpoint
Tags map[string]string
Key-value tags for the EC2 Transit Gateway Connect Peer
TransitGatewayAddress string
The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
TransitGatewayAttachmentId string
The Transit Gateway Connect
TransitGatewayConnectPeerId string
Filters []GetConnectPeerFilter
arn String
EC2 Transit Gateway Connect Peer ARN
bgpAsn String
BGP ASN number assigned customer device
bgpPeerAddress String
The IP address assigned to customer device, which is used as BGP IP address.
bgpTransitGatewayAddresses List<String>
The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
id String
The provider-assigned unique ID for this managed resource.
insideCidrBlocks List<String>
CIDR blocks that will be used for addressing within the tunnel.
peerAddress String
IP addressed assigned to customer device, which is used as tunnel endpoint
tags Map<String,String>
Key-value tags for the EC2 Transit Gateway Connect Peer
transitGatewayAddress String
The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
transitGatewayAttachmentId String
The Transit Gateway Connect
transitGatewayConnectPeerId String
filters List<GetConnectPeerFilter>
arn string
EC2 Transit Gateway Connect Peer ARN
bgpAsn string
BGP ASN number assigned customer device
bgpPeerAddress string
The IP address assigned to customer device, which is used as BGP IP address.
bgpTransitGatewayAddresses string[]
The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
id string
The provider-assigned unique ID for this managed resource.
insideCidrBlocks string[]
CIDR blocks that will be used for addressing within the tunnel.
peerAddress string
IP addressed assigned to customer device, which is used as tunnel endpoint
tags {[key: string]: string}
Key-value tags for the EC2 Transit Gateway Connect Peer
transitGatewayAddress string
The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
transitGatewayAttachmentId string
The Transit Gateway Connect
transitGatewayConnectPeerId string
filters GetConnectPeerFilter[]
arn str
EC2 Transit Gateway Connect Peer ARN
bgp_asn str
BGP ASN number assigned customer device
bgp_peer_address str
The IP address assigned to customer device, which is used as BGP IP address.
bgp_transit_gateway_addresses Sequence[str]
The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
id str
The provider-assigned unique ID for this managed resource.
inside_cidr_blocks Sequence[str]
CIDR blocks that will be used for addressing within the tunnel.
peer_address str
IP addressed assigned to customer device, which is used as tunnel endpoint
tags Mapping[str, str]
Key-value tags for the EC2 Transit Gateway Connect Peer
transit_gateway_address str
The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
transit_gateway_attachment_id str
The Transit Gateway Connect
transit_gateway_connect_peer_id str
filters Sequence[GetConnectPeerFilter]
arn String
EC2 Transit Gateway Connect Peer ARN
bgpAsn String
BGP ASN number assigned customer device
bgpPeerAddress String
The IP address assigned to customer device, which is used as BGP IP address.
bgpTransitGatewayAddresses List<String>
The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
id String
The provider-assigned unique ID for this managed resource.
insideCidrBlocks List<String>
CIDR blocks that will be used for addressing within the tunnel.
peerAddress String
IP addressed assigned to customer device, which is used as tunnel endpoint
tags Map<String>
Key-value tags for the EC2 Transit Gateway Connect Peer
transitGatewayAddress String
The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
transitGatewayAttachmentId String
The Transit Gateway Connect
transitGatewayConnectPeerId String
filters List<Property Map>

Supporting Types

GetConnectPeerFilter

Name This property is required. string
Name of the filter.
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.
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.
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.
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.
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.
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.