Class PublicSubnet.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.PublicSubnet.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<PublicSubnet>
- Enclosing class:
PublicSubnet
@Stability(Stable)
public static final class PublicSubnet.Builder
extends Object
implements software.amazon.jsii.Builder<PublicSubnet>
A fluent builder for
PublicSubnet
.-
Method Summary
Modifier and TypeMethodDescriptionassignIpv6AddressOnCreation
(Boolean assignIpv6AddressOnCreation) Indicates whether a network interface created in this subnet receives an IPv6 address.availabilityZone
(String availabilityZone) The availability zone for the subnet.build()
The CIDR notation for this subnet.static PublicSubnet.Builder
ipv6CidrBlock
(String ipv6CidrBlock) The IPv6 CIDR block.mapPublicIpOnLaunch
(Boolean mapPublicIpOnLaunch) Controls if a public IP is associated to an instance at launch.The VPC which this subnet is part of.
-
Method Details
-
create
@Stability(Stable) public static PublicSubnet.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
PublicSubnet.Builder
.
-
availabilityZone
The availability zone for the subnet.- Parameters:
availabilityZone
- The availability zone for the subnet. This parameter is required.- Returns:
this
-
cidrBlock
The CIDR notation for this subnet.- Parameters:
cidrBlock
- The CIDR notation for this subnet. This parameter is required.- Returns:
this
-
vpcId
The VPC which this subnet is part of.- Parameters:
vpcId
- The VPC which this subnet is part of. This parameter is required.- Returns:
this
-
assignIpv6AddressOnCreation
@Stability(Stable) public PublicSubnet.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation) Indicates whether a network interface created in this subnet receives an IPv6 address.If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
Default: false
- Parameters:
assignIpv6AddressOnCreation
- Indicates whether a network interface created in this subnet receives an IPv6 address. This parameter is required.- Returns:
this
-
ipv6CidrBlock
The IPv6 CIDR block.If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
Default: - no IPv6 CIDR block.
- Parameters:
ipv6CidrBlock
- The IPv6 CIDR block. This parameter is required.- Returns:
this
-
mapPublicIpOnLaunch
Controls if a public IP is associated to an instance at launch.Default: true in Subnet.Public, false in Subnet.Private or Subnet.Isolated.
- Parameters:
mapPublicIpOnLaunch
- Controls if a public IP is associated to an instance at launch. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PublicSubnet>
- Returns:
- a newly built instance of
PublicSubnet
.
-