Class SubnetProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.SubnetProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SubnetProps>
- Enclosing interface:
SubnetProps
@Stability(Stable)
public static final class SubnetProps.Builder
extends Object
implements software.amazon.jsii.Builder<SubnetProps>
A builder for
SubnetProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassignIpv6AddressOnCreation
(Boolean assignIpv6AddressOnCreation) Sets the value ofSubnetProps.getAssignIpv6AddressOnCreation()
availabilityZone
(String availabilityZone) Sets the value ofSubnetProps.getAvailabilityZone()
build()
Builds the configured instance.Sets the value ofSubnetProps.getCidrBlock()
ipv6CidrBlock
(String ipv6CidrBlock) Sets the value ofSubnetProps.getIpv6CidrBlock()
mapPublicIpOnLaunch
(Boolean mapPublicIpOnLaunch) Sets the value ofSubnetProps.getMapPublicIpOnLaunch()
Sets the value ofSubnetProps.getVpcId()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
availabilityZone
Sets the value ofSubnetProps.getAvailabilityZone()
- Parameters:
availabilityZone
- The availability zone for the subnet. This parameter is required.- Returns:
this
-
cidrBlock
Sets the value ofSubnetProps.getCidrBlock()
- Parameters:
cidrBlock
- The CIDR notation for this subnet. This parameter is required.- Returns:
this
-
vpcId
Sets the value ofSubnetProps.getVpcId()
- Parameters:
vpcId
- The VPC which this subnet is part of. This parameter is required.- Returns:
this
-
assignIpv6AddressOnCreation
@Stability(Stable) public SubnetProps.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation) Sets the value ofSubnetProps.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
-
ipv6CidrBlock
Sets the value ofSubnetProps.getIpv6CidrBlock()
- Parameters:
ipv6CidrBlock
- The IPv6 CIDR block. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.- Returns:
this
-
mapPublicIpOnLaunch
Sets the value ofSubnetProps.getMapPublicIpOnLaunch()
- Parameters:
mapPublicIpOnLaunch
- Controls if a public IP is associated to an instance at launch.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SubnetProps>
- Returns:
- a new instance of
SubnetProps
- Throws:
NullPointerException
- if any required attribute was not provided
-