Class PublicSubnetProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.PublicSubnetProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<PublicSubnetProps>
- Enclosing interface:
- PublicSubnetProps
@Stability(Stable)
public static final class PublicSubnetProps.Builder
extends Object
implements software.amazon.jsii.Builder<PublicSubnetProps>
A builder for
PublicSubnetProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavailabilityZone(String availabilityZone) Sets the value ofSubnetProps.getAvailabilityZone()build()Builds the configured instance.Sets the value ofSubnetProps.getCidrBlock()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
-
mapPublicIpOnLaunch
@Stability(Stable) public PublicSubnetProps.Builder mapPublicIpOnLaunch(Boolean 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:
buildin interfacesoftware.amazon.jsii.Builder<PublicSubnetProps>- Returns:
- a new instance of
PublicSubnetProps - Throws:
NullPointerException- if any required attribute was not provided
-