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

aws.networkmanager.TransitGatewayConnectPeerAssociation

Explore with Pulumi AI

Associates a transit gateway Connect peer with a device, and optionally, with a link. If you specify a link, it must be associated with the specified device.

Example Usage

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

const example = new aws.networkmanager.TransitGatewayConnectPeerAssociation("example", {
    globalNetworkId: exampleAwsNetworkmanagerGlobalNetwork.id,
    deviceId: exampleAwsNetworkmanagerDevice.id,
    transitGatewayConnectPeerArn: exampleAwsEc2TransitGatewayConnectPeer.arn,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.networkmanager.TransitGatewayConnectPeerAssociation("example",
    global_network_id=example_aws_networkmanager_global_network["id"],
    device_id=example_aws_networkmanager_device["id"],
    transit_gateway_connect_peer_arn=example_aws_ec2_transit_gateway_connect_peer["arn"])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := networkmanager.NewTransitGatewayConnectPeerAssociation(ctx, "example", &networkmanager.TransitGatewayConnectPeerAssociationArgs{
			GlobalNetworkId:              pulumi.Any(exampleAwsNetworkmanagerGlobalNetwork.Id),
			DeviceId:                     pulumi.Any(exampleAwsNetworkmanagerDevice.Id),
			TransitGatewayConnectPeerArn: pulumi.Any(exampleAwsEc2TransitGatewayConnectPeer.Arn),
		})
		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 = new Aws.NetworkManager.TransitGatewayConnectPeerAssociation("example", new()
    {
        GlobalNetworkId = exampleAwsNetworkmanagerGlobalNetwork.Id,
        DeviceId = exampleAwsNetworkmanagerDevice.Id,
        TransitGatewayConnectPeerArn = exampleAwsEc2TransitGatewayConnectPeer.Arn,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.networkmanager.TransitGatewayConnectPeerAssociation;
import com.pulumi.aws.networkmanager.TransitGatewayConnectPeerAssociationArgs;
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) {
        var example = new TransitGatewayConnectPeerAssociation("example", TransitGatewayConnectPeerAssociationArgs.builder()
            .globalNetworkId(exampleAwsNetworkmanagerGlobalNetwork.id())
            .deviceId(exampleAwsNetworkmanagerDevice.id())
            .transitGatewayConnectPeerArn(exampleAwsEc2TransitGatewayConnectPeer.arn())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:networkmanager:TransitGatewayConnectPeerAssociation
    properties:
      globalNetworkId: ${exampleAwsNetworkmanagerGlobalNetwork.id}
      deviceId: ${exampleAwsNetworkmanagerDevice.id}
      transitGatewayConnectPeerArn: ${exampleAwsEc2TransitGatewayConnectPeer.arn}
Copy

Create TransitGatewayConnectPeerAssociation Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TransitGatewayConnectPeerAssociation(name: string, args: TransitGatewayConnectPeerAssociationArgs, opts?: CustomResourceOptions);
@overload
def TransitGatewayConnectPeerAssociation(resource_name: str,
                                         args: TransitGatewayConnectPeerAssociationArgs,
                                         opts: Optional[ResourceOptions] = None)

@overload
def TransitGatewayConnectPeerAssociation(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         device_id: Optional[str] = None,
                                         global_network_id: Optional[str] = None,
                                         transit_gateway_connect_peer_arn: Optional[str] = None,
                                         link_id: Optional[str] = None)
func NewTransitGatewayConnectPeerAssociation(ctx *Context, name string, args TransitGatewayConnectPeerAssociationArgs, opts ...ResourceOption) (*TransitGatewayConnectPeerAssociation, error)
public TransitGatewayConnectPeerAssociation(string name, TransitGatewayConnectPeerAssociationArgs args, CustomResourceOptions? opts = null)
public TransitGatewayConnectPeerAssociation(String name, TransitGatewayConnectPeerAssociationArgs args)
public TransitGatewayConnectPeerAssociation(String name, TransitGatewayConnectPeerAssociationArgs args, CustomResourceOptions options)
type: aws:networkmanager:TransitGatewayConnectPeerAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TransitGatewayConnectPeerAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TransitGatewayConnectPeerAssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TransitGatewayConnectPeerAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TransitGatewayConnectPeerAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TransitGatewayConnectPeerAssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var transitGatewayConnectPeerAssociationResource = new Aws.NetworkManager.TransitGatewayConnectPeerAssociation("transitGatewayConnectPeerAssociationResource", new()
{
    DeviceId = "string",
    GlobalNetworkId = "string",
    TransitGatewayConnectPeerArn = "string",
    LinkId = "string",
});
Copy
example, err := networkmanager.NewTransitGatewayConnectPeerAssociation(ctx, "transitGatewayConnectPeerAssociationResource", &networkmanager.TransitGatewayConnectPeerAssociationArgs{
	DeviceId:                     pulumi.String("string"),
	GlobalNetworkId:              pulumi.String("string"),
	TransitGatewayConnectPeerArn: pulumi.String("string"),
	LinkId:                       pulumi.String("string"),
})
Copy
var transitGatewayConnectPeerAssociationResource = new TransitGatewayConnectPeerAssociation("transitGatewayConnectPeerAssociationResource", TransitGatewayConnectPeerAssociationArgs.builder()
    .deviceId("string")
    .globalNetworkId("string")
    .transitGatewayConnectPeerArn("string")
    .linkId("string")
    .build());
Copy
transit_gateway_connect_peer_association_resource = aws.networkmanager.TransitGatewayConnectPeerAssociation("transitGatewayConnectPeerAssociationResource",
    device_id="string",
    global_network_id="string",
    transit_gateway_connect_peer_arn="string",
    link_id="string")
Copy
const transitGatewayConnectPeerAssociationResource = new aws.networkmanager.TransitGatewayConnectPeerAssociation("transitGatewayConnectPeerAssociationResource", {
    deviceId: "string",
    globalNetworkId: "string",
    transitGatewayConnectPeerArn: "string",
    linkId: "string",
});
Copy
type: aws:networkmanager:TransitGatewayConnectPeerAssociation
properties:
    deviceId: string
    globalNetworkId: string
    linkId: string
    transitGatewayConnectPeerArn: string
Copy

TransitGatewayConnectPeerAssociation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TransitGatewayConnectPeerAssociation resource accepts the following input properties:

DeviceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the device.
GlobalNetworkId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the global network.
TransitGatewayConnectPeerArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the Connect peer.
LinkId Changes to this property will trigger replacement. string
The ID of the link.
DeviceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the device.
GlobalNetworkId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the global network.
TransitGatewayConnectPeerArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the Connect peer.
LinkId Changes to this property will trigger replacement. string
The ID of the link.
deviceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the device.
globalNetworkId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the global network.
transitGatewayConnectPeerArn
This property is required.
Changes to this property will trigger replacement.
String
The Amazon Resource Name (ARN) of the Connect peer.
linkId Changes to this property will trigger replacement. String
The ID of the link.
deviceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the device.
globalNetworkId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the global network.
transitGatewayConnectPeerArn
This property is required.
Changes to this property will trigger replacement.
string
The Amazon Resource Name (ARN) of the Connect peer.
linkId Changes to this property will trigger replacement. string
The ID of the link.
device_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the device.
global_network_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the global network.
transit_gateway_connect_peer_arn
This property is required.
Changes to this property will trigger replacement.
str
The Amazon Resource Name (ARN) of the Connect peer.
link_id Changes to this property will trigger replacement. str
The ID of the link.
deviceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the device.
globalNetworkId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the global network.
transitGatewayConnectPeerArn
This property is required.
Changes to this property will trigger replacement.
String
The Amazon Resource Name (ARN) of the Connect peer.
linkId Changes to this property will trigger replacement. String
The ID of the link.

Outputs

All input properties are implicitly available as output properties. Additionally, the TransitGatewayConnectPeerAssociation resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TransitGatewayConnectPeerAssociation Resource

Get an existing TransitGatewayConnectPeerAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TransitGatewayConnectPeerAssociationState, opts?: CustomResourceOptions): TransitGatewayConnectPeerAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        device_id: Optional[str] = None,
        global_network_id: Optional[str] = None,
        link_id: Optional[str] = None,
        transit_gateway_connect_peer_arn: Optional[str] = None) -> TransitGatewayConnectPeerAssociation
func GetTransitGatewayConnectPeerAssociation(ctx *Context, name string, id IDInput, state *TransitGatewayConnectPeerAssociationState, opts ...ResourceOption) (*TransitGatewayConnectPeerAssociation, error)
public static TransitGatewayConnectPeerAssociation Get(string name, Input<string> id, TransitGatewayConnectPeerAssociationState? state, CustomResourceOptions? opts = null)
public static TransitGatewayConnectPeerAssociation get(String name, Output<String> id, TransitGatewayConnectPeerAssociationState state, CustomResourceOptions options)
resources:  _:    type: aws:networkmanager:TransitGatewayConnectPeerAssociation    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DeviceId Changes to this property will trigger replacement. string
The ID of the device.
GlobalNetworkId Changes to this property will trigger replacement. string
The ID of the global network.
LinkId Changes to this property will trigger replacement. string
The ID of the link.
TransitGatewayConnectPeerArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the Connect peer.
DeviceId Changes to this property will trigger replacement. string
The ID of the device.
GlobalNetworkId Changes to this property will trigger replacement. string
The ID of the global network.
LinkId Changes to this property will trigger replacement. string
The ID of the link.
TransitGatewayConnectPeerArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the Connect peer.
deviceId Changes to this property will trigger replacement. String
The ID of the device.
globalNetworkId Changes to this property will trigger replacement. String
The ID of the global network.
linkId Changes to this property will trigger replacement. String
The ID of the link.
transitGatewayConnectPeerArn Changes to this property will trigger replacement. String
The Amazon Resource Name (ARN) of the Connect peer.
deviceId Changes to this property will trigger replacement. string
The ID of the device.
globalNetworkId Changes to this property will trigger replacement. string
The ID of the global network.
linkId Changes to this property will trigger replacement. string
The ID of the link.
transitGatewayConnectPeerArn Changes to this property will trigger replacement. string
The Amazon Resource Name (ARN) of the Connect peer.
device_id Changes to this property will trigger replacement. str
The ID of the device.
global_network_id Changes to this property will trigger replacement. str
The ID of the global network.
link_id Changes to this property will trigger replacement. str
The ID of the link.
transit_gateway_connect_peer_arn Changes to this property will trigger replacement. str
The Amazon Resource Name (ARN) of the Connect peer.
deviceId Changes to this property will trigger replacement. String
The ID of the device.
globalNetworkId Changes to this property will trigger replacement. String
The ID of the global network.
linkId Changes to this property will trigger replacement. String
The ID of the link.
transitGatewayConnectPeerArn Changes to this property will trigger replacement. String
The Amazon Resource Name (ARN) of the Connect peer.

Import

Using pulumi import, import aws_networkmanager_transit_gateway_connect_peer_association using the global network ID and customer gateway ARN. For example:

$ pulumi import aws:networkmanager/transitGatewayConnectPeerAssociation:TransitGatewayConnectPeerAssociation example global-network-0d47f6t230mz46dy4,arn:aws:ec2:us-west-2:123456789012:transit-gateway-connect-peer/tgw-connect-peer-12345678
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.