Class SubnetConfiguration.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.SubnetConfiguration.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SubnetConfiguration>
- Enclosing interface:
SubnetConfiguration
@Stability(Stable)
public static final class SubnetConfiguration.Builder
extends Object
implements software.amazon.jsii.Builder<SubnetConfiguration>
A builder for
SubnetConfiguration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofSubnetConfiguration.getCidrMask()
ipv6AssignAddressOnCreation
(Boolean ipv6AssignAddressOnCreation) Sets the value ofSubnetConfiguration.getIpv6AssignAddressOnCreation()
mapPublicIpOnLaunch
(Boolean mapPublicIpOnLaunch) Sets the value ofSubnetConfiguration.getMapPublicIpOnLaunch()
Sets the value ofSubnetConfiguration.getName()
Sets the value ofSubnetConfiguration.getReserved()
subnetType
(SubnetType subnetType) Sets the value ofSubnetConfiguration.getSubnetType()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the value ofSubnetConfiguration.getName()
- Parameters:
name
- Logical name for the subnet group. This parameter is required. This name can be used when selecting VPC subnets to distinguish between different subnet groups of the same type.- Returns:
this
-
subnetType
Sets the value ofSubnetConfiguration.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.- Returns:
this
-
cidrMask
Sets the value ofSubnetConfiguration.getCidrMask()
- Parameters:
cidrMask
- The number of leading 1 bits in the routing mask. The number of available IP addresses in each subnet of this group will be equal to2^(32 - cidrMask) - 2
.Valid values are
16--28
.Note this is specific to IPv4 addresses.
- Returns:
this
-
ipv6AssignAddressOnCreation
@Stability(Stable) public SubnetConfiguration.Builder ipv6AssignAddressOnCreation(Boolean ipv6AssignAddressOnCreation) Sets the value ofSubnetConfiguration.getIpv6AssignAddressOnCreation()
- Parameters:
ipv6AssignAddressOnCreation
- This property is specific to dual stack VPCs. If set to false, then an IPv6 address will not be automatically assigned.Note this is specific to IPv6 addresses.
- Returns:
this
-
mapPublicIpOnLaunch
@Stability(Stable) public SubnetConfiguration.Builder mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch) Sets the value ofSubnetConfiguration.getMapPublicIpOnLaunch()
- Parameters:
mapPublicIpOnLaunch
- Controls if a public IPv4 address is associated to an instance at launch. Note this is specific to IPv4 addresses.- Returns:
this
-
reserved
Sets the value ofSubnetConfiguration.getReserved()
- Parameters:
reserved
- Controls if subnet IP space needs to be reserved. When true, the IP space for the subnet is reserved but no actual resources are provisioned. This space is only dependent on the number of availability zones and oncidrMask
- all other subnet properties are ignored.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SubnetConfiguration>
- Returns:
- a new instance of
SubnetConfiguration
- Throws:
NullPointerException
- if any required attribute was not provided
-