Interface AttachVpcOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AttachVpcOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:49.790Z")
@Stability(Experimental)
public interface AttachVpcOptions
extends software.amazon.jsii.JsiiSerializable
(experimental) Options for creating an Attachment via the attachVpc() method.
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());
// Add a static route to direct traffic
routeTable.addRoute("StaticRoute", attachment, "10.0.0.0/16");
// Block unwanted traffic with a blackhole route
routeTable.addBlackholeRoute("BlackholeRoute", "172.16.0.0/16");
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAttachVpcOptionsstatic final classAn implementation forAttachVpcOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic AttachVpcOptions.Builderbuilder()default ITransitGatewayRouteTable(experimental) An optional route table to associate with this VPC attachment.default List<ITransitGatewayRouteTable> (experimental) A list of optional route tables to propagate routes to.(experimental) A list of one or more subnets to place the attachment in.default String(experimental) Physical name of this Transit Gateway VPC Attachment.getVpc()(experimental) A VPC attachment(s) will get assigned to.(experimental) The VPC attachment options.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getSubnets
(experimental) A list of one or more subnets to place the attachment in.It is recommended to specify more subnets for better availability.
-
getVpc
(experimental) A VPC attachment(s) will get assigned to. -
getAssociationRouteTable
(experimental) An optional route table to associate with this VPC attachment.Default: - No associations will be created unless it is for the default route table and automatic association is enabled.
-
getPropagationRouteTables
@Stability(Experimental) @Nullable default List<ITransitGatewayRouteTable> getPropagationRouteTables()(experimental) A list of optional route tables to propagate routes to.Default: - No propagations will be created unless it is for the default route table and automatic propagation is enabled.
-
getTransitGatewayAttachmentName
(experimental) Physical name of this Transit Gateway VPC Attachment.Default: - Assigned by CloudFormation.
-
getVpcAttachmentOptions
@Stability(Experimental) @Nullable default ITransitGatewayVpcAttachmentOptions getVpcAttachmentOptions()(experimental) The VPC attachment options.Default: - All options are disabled.
-
builder
- Returns:
- a
AttachVpcOptions.BuilderofAttachVpcOptions
-