Class Subnet.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.Subnet.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Subnet>
- Enclosing class:
Subnet
@Stability(Stable)
public static final class Subnet.Builder
extends Object
implements software.amazon.jsii.Builder<Subnet>
A fluent builder for
Subnet
.-
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 Subnet.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 Subnet.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
Subnet.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 Subnet.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
-