Interface SubnetV2Props
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
SubnetV2Props.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:24:11.444Z")
@Stability(Experimental)
public interface SubnetV2Props
extends software.amazon.jsii.JsiiSerializable
(experimental) Properties to define subnet for VPC.
Example:
VpcV2 myVpc = new VpcV2(this, "Vpc"); RouteTable routeTable = RouteTable.Builder.create(this, "RouteTable") .vpc(myVpc) .build(); SubnetV2 subnet = SubnetV2.Builder.create(this, "Subnet") .vpc(myVpc) .availabilityZone("eu-west-2a") .ipv4CidrBlock(new IpCidr("10.0.0.0/24")) .subnetType(SubnetType.PRIVATE_ISOLATED) .build(); NatGateway natgw = NatGateway.Builder.create(this, "NatGW") .subnet(subnet) .vpc(myVpc) .connectivityType(NatConnectivityType.PRIVATE) .privateIpAddress("10.0.0.42") .build(); Route.Builder.create(this, "NatGwRoute") .routeTable(routeTable) .destination("0.0.0.0/0") .target(Map.of("gateway", natgw)) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forSubnetV2Props
static final class
An implementation forSubnetV2Props
-
Method Summary
Modifier and TypeMethodDescriptionstatic SubnetV2Props.Builder
builder()
default Boolean
(experimental) Indicates whether a network interface created in this subnet receives an IPv6 address.(experimental) Custom AZ for the subnet.(experimental) ipv4 cidr to assign to this subnet.default IpCidr
(experimental) Ipv6 CIDR Range for subnet.default IRouteTable
(experimental) Custom Route for subnet.default String
(experimental) Subnet name.(experimental) The type of Subnet to configure.getVpc()
(experimental) VPC Prop.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAvailabilityZone
(experimental) Custom AZ for the subnet. -
getIpv4CidrBlock
(experimental) ipv4 cidr to assign to this subnet.See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock
-
getSubnetType
(experimental) The type of Subnet to configure.The Subnet type will control the ability to route and connect to the Internet.
TODO: Add validation check
subnetType
when adding resources (e.g. cannot add NatGateway to private) -
getVpc
(experimental) VPC Prop. -
getAssignIpv6AddressOnCreation
(experimental) Indicates whether a network interface created in this subnet receives an IPv6 address.If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
Default: - undefined in case not provided as an input
-
getIpv6CidrBlock
(experimental) Ipv6 CIDR Range for subnet.Default: - No Ipv6 address
-
getRouteTable
(experimental) Custom Route for subnet.Default: - a default route table created
-
getSubnetName
(experimental) Subnet name.Default: - provisioned with an autogenerated name by CDK
-
builder
- Returns:
- a
SubnetV2Props.Builder
ofSubnetV2Props
-