Class SubnetV2Props.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.alpha.SubnetV2Props.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SubnetV2Props>
- Enclosing interface:
SubnetV2Props
@Stability(Experimental)
public static final class SubnetV2Props.Builder
extends Object
implements software.amazon.jsii.Builder<SubnetV2Props>
A builder for
SubnetV2Props-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation) Sets the value ofSubnetV2Props.getAssignIpv6AddressOnCreation()availabilityZone(String availabilityZone) Sets the value ofSubnetV2Props.getAvailabilityZone()build()Builds the configured instance.defaultRouteTableName(String defaultRouteTableName) Sets the value ofSubnetV2Props.getDefaultRouteTableName()ipv4CidrBlock(IpCidr ipv4CidrBlock) Sets the value ofSubnetV2Props.getIpv4CidrBlock()ipv6CidrBlock(IpCidr ipv6CidrBlock) Sets the value ofSubnetV2Props.getIpv6CidrBlock()mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch) Sets the value ofSubnetV2Props.getMapPublicIpOnLaunch()routeTable(IRouteTable routeTable) Sets the value ofSubnetV2Props.getRouteTable()subnetName(String subnetName) Sets the value ofSubnetV2Props.getSubnetName()subnetType(SubnetType subnetType) Sets the value ofSubnetV2Props.getSubnetType()Sets the value ofSubnetV2Props.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
availabilityZone
Sets the value ofSubnetV2Props.getAvailabilityZone()- Parameters:
availabilityZone- Custom AZ for the subnet. This parameter is required.- Returns:
this
-
ipv4CidrBlock
Sets the value ofSubnetV2Props.getIpv4CidrBlock()- Parameters:
ipv4CidrBlock- ipv4 cidr to assign to this subnet. This parameter is required. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock- Returns:
this
-
subnetType
Sets the value ofSubnetV2Props.getSubnetType()- Parameters:
subnetType- The type of Subnet to configure. This parameter is required. The Subnet type will control the ability to route and connect to the Internet.TODO: Add validation check
subnetTypewhen adding resources (e.g. cannot add NatGateway to private)- Returns:
this
-
vpc
Sets the value ofSubnetV2Props.getVpc()- Parameters:
vpc- VPC Prop. This parameter is required.- Returns:
this
-
assignIpv6AddressOnCreation
@Stability(Experimental) public SubnetV2Props.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation) Sets the value ofSubnetV2Props.getAssignIpv6AddressOnCreation()- Parameters:
assignIpv6AddressOnCreation- Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.- Returns:
this
-
defaultRouteTableName
@Stability(Experimental) public SubnetV2Props.Builder defaultRouteTableName(String defaultRouteTableName) Sets the value ofSubnetV2Props.getDefaultRouteTableName()- Parameters:
defaultRouteTableName- Name of the default RouteTable created by CDK to be used for tagging.- Returns:
this
-
ipv6CidrBlock
Sets the value ofSubnetV2Props.getIpv6CidrBlock()- Parameters:
ipv6CidrBlock- Ipv6 CIDR Range for subnet.- Returns:
this
-
mapPublicIpOnLaunch
@Stability(Experimental) public SubnetV2Props.Builder mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch) Sets the value ofSubnetV2Props.getMapPublicIpOnLaunch()- Parameters:
mapPublicIpOnLaunch- Controls if instances launched into the subnet should be assigned a public IP address. This property can only be set for public subnets.- Returns:
this
-
routeTable
Sets the value ofSubnetV2Props.getRouteTable()- Parameters:
routeTable- Custom Route for subnet.- Returns:
this
-
subnetName
Sets the value ofSubnetV2Props.getSubnetName()- Parameters:
subnetName- Subnet name.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<SubnetV2Props>- Returns:
- a new instance of
SubnetV2Props - Throws:
NullPointerException- if any required attribute was not provided
-