Class SubnetV2.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.alpha.SubnetV2.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SubnetV2>
- Enclosing class:
SubnetV2
@Stability(Experimental)
public static final class SubnetV2.Builder
extends Object
implements software.amazon.jsii.Builder<SubnetV2>
(experimental) A fluent builder for
SubnetV2
.-
Method Summary
Modifier and TypeMethodDescriptionassignIpv6AddressOnCreation
(Boolean assignIpv6AddressOnCreation) (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address.availabilityZone
(String availabilityZone) (experimental) Custom AZ for the subnet.build()
static SubnetV2.Builder
ipv4CidrBlock
(IpCidr ipv4CidrBlock) (experimental) ipv4 cidr to assign to this subnet.ipv6CidrBlock
(IpCidr ipv6CidrBlock) (experimental) Ipv6 CIDR Range for subnet.routeTable
(IRouteTable routeTable) (experimental) Custom Route for subnet.subnetName
(String subnetName) (experimental) Subnet name.subnetType
(SubnetType subnetType) (experimental) The type of Subnet to configure.(experimental) VPC Prop.
-
Method Details
-
create
@Stability(Experimental) public static SubnetV2.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- The parent Construct that this resource will be part of. This parameter is required.id
- The unique identifier for this resource. This parameter is required.- Returns:
- a new instance of
SubnetV2.Builder
.
-
availabilityZone
(experimental) Custom AZ for the subnet.- Parameters:
availabilityZone
- Custom AZ for the subnet. This parameter is required.- Returns:
this
-
ipv4CidrBlock
(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
- Parameters:
ipv4CidrBlock
- ipv4 cidr to assign to this subnet. This parameter is required.- Returns:
this
-
subnetType
(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)- Parameters:
subnetType
- The type of Subnet to configure. This parameter is required.- Returns:
this
-
vpc
(experimental) VPC Prop.- Parameters:
vpc
- VPC Prop. This parameter is required.- Returns:
this
-
assignIpv6AddressOnCreation
@Stability(Experimental) public SubnetV2.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation) (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
- Parameters:
assignIpv6AddressOnCreation
- Indicates whether a network interface created in this subnet receives an IPv6 address. This parameter is required.- Returns:
this
-
ipv6CidrBlock
(experimental) Ipv6 CIDR Range for subnet.Default: - No Ipv6 address
- Parameters:
ipv6CidrBlock
- Ipv6 CIDR Range for subnet. This parameter is required.- Returns:
this
-
routeTable
(experimental) Custom Route for subnet.Default: - a default route table created
- Parameters:
routeTable
- Custom Route for subnet. This parameter is required.- Returns:
this
-
subnetName
(experimental) Subnet name.Default: - provisioned with an autogenerated name by CDK
- Parameters:
subnetName
- Subnet name. This parameter is required.- Returns:
this
-
build
-