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 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

      @Stability(Stable) public PublicSubnet.Builder availabilityZone(String availabilityZone)
      The availability zone for the subnet.

      Parameters:
      availabilityZone - The availability zone for the subnet. This parameter is required.
      Returns:
      this
    • cidrBlock

      @Stability(Stable) public PublicSubnet.Builder cidrBlock(String cidrBlock)
      The CIDR notation for this subnet.

      Parameters:
      cidrBlock - The CIDR notation for this subnet. This parameter is required.
      Returns:
      this
    • vpcId

      @Stability(Stable) public PublicSubnet.Builder vpcId(String 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

      @Stability(Stable) public PublicSubnet.Builder ipv6CidrBlock(String 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

      @Stability(Stable) public PublicSubnet.Builder mapPublicIpOnLaunch(Boolean 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

      @Stability(Stable) public PublicSubnet build()
      Specified by:
      build in interface software.amazon.jsii.Builder<PublicSubnet>
      Returns:
      a newly built instance of PublicSubnet.