Class SubnetProps.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • availabilityZone

      @Stability(Stable) public SubnetProps.Builder availabilityZone(String availabilityZone)
      Parameters:
      availabilityZone - The availability zone for the subnet. This parameter is required.
      Returns:
      this
    • cidrBlock

      @Stability(Stable) public SubnetProps.Builder cidrBlock(String cidrBlock)
      Sets the value of SubnetProps.getCidrBlock()
      Parameters:
      cidrBlock - The CIDR notation for this subnet. This parameter is required.
      Returns:
      this
    • vpcId

      @Stability(Stable) public SubnetProps.Builder vpcId(String vpcId)
      Sets the value of SubnetProps.getVpcId()
      Parameters:
      vpcId - The VPC which this subnet is part of. This parameter is required.
      Returns:
      this
    • assignIpv6AddressOnCreation

      @Stability(Stable) public SubnetProps.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation)
      Parameters:
      assignIpv6AddressOnCreation - Indicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
      Returns:
      this
    • ipv6CidrBlock

      @Stability(Stable) public SubnetProps.Builder ipv6CidrBlock(String ipv6CidrBlock)
      Parameters:
      ipv6CidrBlock - The IPv6 CIDR block. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
      Returns:
      this
    • mapPublicIpOnLaunch

      @Stability(Stable) public SubnetProps.Builder mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)
      Parameters:
      mapPublicIpOnLaunch - Controls if a public IP is associated to an instance at launch.
      Returns:
      this
    • build

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