Class TransitGateway
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.alpha.TransitGateway
- All Implemented Interfaces:
IResource,IRouteTarget,ITransitGateway,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:49.827Z")
@Stability(Experimental)
public class TransitGateway
extends Resource
implements ITransitGateway, IRouteTarget
(experimental) Creates a Transit Gateway.
Example:
TransitGateway transitGateway = new TransitGateway(this, "MyTransitGateway");
ITransitGatewayRouteTable routeTable = transitGateway.addRouteTable("CustomRouteTable");
VpcV2 myVpc = new VpcV2(this, "Vpc");
SubnetV2 subnet = SubnetV2.Builder.create(this, "Subnet")
.vpc(myVpc)
.availabilityZone("eu-west-2a")
.ipv4CidrBlock(new IpCidr("10.0.0.0/24"))
.subnetType(SubnetType.PUBLIC)
.build();
ITransitGatewayVpcAttachment attachment = transitGateway.attachVpc("VpcAttachment", AttachVpcOptions.builder()
.vpc(myVpc)
.subnets(List.of(subnet))
.build());
// Associate an attachment with a route table
routeTable.addAssociation("Association", attachment);
// Enable route propagation for an attachment
routeTable.enablePropagation("Propagation", attachment);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forTransitGateway.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.alpha.IRouteTarget
IRouteTarget.Jsii$Default, IRouteTarget.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.alpha.ITransitGateway
ITransitGateway.Jsii$Default, ITransitGateway.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTransitGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedTransitGateway(software.amazon.jsii.JsiiObjectRef objRef) TransitGateway(software.constructs.Construct scope, String id) TransitGateway(software.constructs.Construct scope, String id, TransitGatewayProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddRouteTable(String id) (experimental) Adds a new route table to the Transit Gateway.attachVpc(String id, AttachVpcOptions options) (experimental) Attaches a VPC to the Transit Gateway.(experimental) The default route table associated with the Transit Gateway.(experimental) Indicates whether new attachments are automatically associated with the default route table.(experimental) Indicates whether route propagation to the default route table is enabled.(experimental) Whether or not DNS support is enabled on the Transit Gateway.(experimental) The ID of the route target.(experimental) The type of router used in the route.(experimental) Whether or not security group referencing support is enabled on the Transit Gateway.(experimental) The Amazon Resource Name (ARN) of the Transit Gateway.(experimental) The unique identifier of the Transit Gateway.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
TransitGateway
protected TransitGateway(software.amazon.jsii.JsiiObjectRef objRef) -
TransitGateway
protected TransitGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
TransitGateway
@Stability(Experimental) public TransitGateway(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable TransitGatewayProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
TransitGateway
@Stability(Experimental) public TransitGateway(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
addRouteTable
@Stability(Experimental) @NotNull public ITransitGatewayRouteTable addRouteTable(@NotNull String id) (experimental) Adds a new route table to the Transit Gateway.- Parameters:
id- This parameter is required.- Returns:
- The created Transit Gateway route table.
-
attachVpc
@Stability(Experimental) @NotNull public ITransitGatewayVpcAttachment attachVpc(@NotNull String id, @NotNull AttachVpcOptions options) (experimental) Attaches a VPC to the Transit Gateway.- Parameters:
id- This parameter is required.options- This parameter is required.- Returns:
- The created Transit Gateway VPC attachment.
-
getDefaultRouteTable
(experimental) The default route table associated with the Transit Gateway.This route table is created by the CDK and is used to manage the routes for attachments that do not have an explicitly defined route table association.
- Specified by:
getDefaultRouteTablein interfaceITransitGateway
-
getDefaultRouteTableAssociation
(experimental) Indicates whether new attachments are automatically associated with the default route table.If set to
true, any VPC or VPN attachment will be automatically associated with the default route table unless otherwise specified.- Specified by:
getDefaultRouteTableAssociationin interfaceITransitGateway
-
getDefaultRouteTablePropagation
(experimental) Indicates whether route propagation to the default route table is enabled.When set to
true, routes from attachments will be automatically propagated to the default route table unless propagation is explicitly disabled.- Specified by:
getDefaultRouteTablePropagationin interfaceITransitGateway
-
getDnsSupport
(experimental) Whether or not DNS support is enabled on the Transit Gateway.- Specified by:
getDnsSupportin interfaceITransitGateway
-
getRouterTargetId
(experimental) The ID of the route target.- Specified by:
getRouterTargetIdin interfaceIRouteTarget
-
getRouterType
(experimental) The type of router used in the route.- Specified by:
getRouterTypein interfaceIRouteTarget
-
getSecurityGroupReferencingSupport
(experimental) Whether or not security group referencing support is enabled on the Transit Gateway.- Specified by:
getSecurityGroupReferencingSupportin interfaceITransitGateway
-
getTransitGatewayArn
(experimental) The Amazon Resource Name (ARN) of the Transit Gateway.The ARN uniquely identifies the Transit Gateway across AWS and is commonly used for permissions and resource tracking.
- Specified by:
getTransitGatewayArnin interfaceITransitGateway
-
getTransitGatewayId
(experimental) The unique identifier of the Transit Gateway.This ID is automatically assigned by AWS upon creation of the Transit Gateway and is used to reference it in various configurations and operations.
- Specified by:
getTransitGatewayIdin interfaceITransitGateway
-