PeeringAttachment

class PeeringAttachment : KotlinCustomResource

Manages an EC2 Transit Gateway Peering Attachment. For examples of custom route table association and propagation, see the EC2 Transit Gateway Networking Examples Guide.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.Provider;
import com.pulumi.aws.ProviderArgs;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
import com.pulumi.aws.ec2transitgateway.TransitGateway;
import com.pulumi.aws.ec2transitgateway.TransitGatewayArgs;
import com.pulumi.aws.ec2transitgateway.PeeringAttachment;
import com.pulumi.aws.ec2transitgateway.PeeringAttachmentArgs;
import com.pulumi.resources.CustomResourceOptions;
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 local = new Provider("local", ProviderArgs.builder()
.region("us-east-1")
.build());
var peer = new Provider("peer", ProviderArgs.builder()
.region("us-west-2")
.build());
final var peerRegion = AwsFunctions.getRegion();
var localTransitGateway = new TransitGateway("localTransitGateway", TransitGatewayArgs.builder()
.tags(Map.of("Name", "Local TGW"))
.build(), CustomResourceOptions.builder()
.provider(aws.local())
.build());
var peerTransitGateway = new TransitGateway("peerTransitGateway", TransitGatewayArgs.builder()
.tags(Map.of("Name", "Peer TGW"))
.build(), CustomResourceOptions.builder()
.provider(aws.peer())
.build());
var example = new PeeringAttachment("example", PeeringAttachmentArgs.builder()
.peerAccountId(peerTransitGateway.ownerId())
.peerRegion(peerRegion.applyValue(getRegionResult -> getRegionResult.name()))
.peerTransitGatewayId(peerTransitGateway.id())
.transitGatewayId(localTransitGateway.id())
.tags(Map.of("Name", "TGW Peering Requestor"))
.build());
}
}

Import

aws_ec2_transit_gateway_peering_attachment can be imported by using the EC2 Transit Gateway Attachment identifier, e.g.,

$ pulumi import aws:ec2transitgateway/peeringAttachment:PeeringAttachment example tgw-attach-12345678

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val peerAccountId: Output<String>

Account ID of EC2 Transit Gateway to peer with. Defaults to the account ID the AWS provider is currently connected to.

Link copied to clipboard
val peerRegion: Output<String>

Region of EC2 Transit Gateway to peer with.

Link copied to clipboard

Identifier of EC2 Transit Gateway to peer with.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

Key-value tags for the EC2 Transit Gateway Peering Attachment. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard

Identifier of EC2 Transit Gateway.

Link copied to clipboard
val urn: Output<String>