Class SubnetConfiguration.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.SubnetConfiguration.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<SubnetConfiguration>
Enclosing interface:
SubnetConfiguration

@Stability(Stable) public static final class SubnetConfiguration.Builder extends Object implements software.amazon.jsii.Builder<SubnetConfiguration>
A builder for SubnetConfiguration
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      @Stability(Stable) public SubnetConfiguration.Builder name(String name)
      Parameters:
      name - Logical name for the subnet group. This parameter is required. This name can be used when selecting VPC subnets to distinguish between different subnet groups of the same type.
      Returns:
      this
    • subnetType

      @Stability(Stable) public SubnetConfiguration.Builder subnetType(SubnetType subnetType)
      Parameters:
      subnetType - The type of Subnet to configure. This parameter is required. The Subnet type will control the ability to route and connect to the Internet.
      Returns:
      this
    • cidrMask

      @Stability(Stable) public SubnetConfiguration.Builder cidrMask(Number cidrMask)
      Parameters:
      cidrMask - The number of leading 1 bits in the routing mask. The number of available IP addresses in each subnet of this group will be equal to 2^(32 - cidrMask) - 2.

      Valid values are 16--28.

      Note this is specific to IPv4 addresses.

      Returns:
      this
    • ipv6AssignAddressOnCreation

      @Stability(Stable) public SubnetConfiguration.Builder ipv6AssignAddressOnCreation(Boolean ipv6AssignAddressOnCreation)
      Parameters:
      ipv6AssignAddressOnCreation - This property is specific to dual stack VPCs. If set to false, then an IPv6 address will not be automatically assigned.

      Note this is specific to IPv6 addresses.

      Returns:
      this
    • mapPublicIpOnLaunch

      @Stability(Stable) public SubnetConfiguration.Builder mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)
      Parameters:
      mapPublicIpOnLaunch - Controls if a public IPv4 address is associated to an instance at launch. Note this is specific to IPv4 addresses.
      Returns:
      this
    • reserved

      @Stability(Stable) public SubnetConfiguration.Builder reserved(Boolean reserved)
      Parameters:
      reserved - Controls if subnet IP space needs to be reserved. When true, the IP space for the subnet is reserved but no actual resources are provisioned. This space is only dependent on the number of availability zones and on cidrMask - all other subnet properties are ignored.
      Returns:
      this
    • build

      @Stability(Stable) public SubnetConfiguration build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<SubnetConfiguration>
      Returns:
      a new instance of SubnetConfiguration
      Throws:
      NullPointerException - if any required attribute was not provided