Class SubnetV2.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.alpha.SubnetV2.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<SubnetV2>
Enclosing class:
SubnetV2

@Stability(Experimental) public static final class SubnetV2.Builder extends Object implements software.amazon.jsii.Builder<SubnetV2>
(experimental) A fluent builder for SubnetV2.
  • Method Details

    • create

      @Stability(Experimental) public static SubnetV2.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - The parent Construct that this resource will be part of. This parameter is required.
      id - The unique identifier for this resource. This parameter is required.
      Returns:
      a new instance of SubnetV2.Builder.
    • availabilityZone

      @Stability(Experimental) public SubnetV2.Builder availabilityZone(String availabilityZone)
      (experimental) Custom AZ for the subnet.

      Parameters:
      availabilityZone - Custom AZ for the subnet. This parameter is required.
      Returns:
      this
    • ipv4CidrBlock

      @Stability(Experimental) public SubnetV2.Builder ipv4CidrBlock(IpCidr ipv4CidrBlock)
      (experimental) ipv4 cidr to assign to this subnet.

      See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock

      Parameters:
      ipv4CidrBlock - ipv4 cidr to assign to this subnet. This parameter is required.
      Returns:
      this
    • subnetType

      @Stability(Experimental) public SubnetV2.Builder subnetType(SubnetType subnetType)
      (experimental) The type of Subnet to configure.

      The Subnet type will control the ability to route and connect to the Internet.

      TODO: Add validation check subnetType when adding resources (e.g. cannot add NatGateway to private)

      Parameters:
      subnetType - The type of Subnet to configure. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Experimental) public SubnetV2.Builder vpc(IVpcV2 vpc)
      (experimental) VPC Prop.

      Parameters:
      vpc - VPC Prop. This parameter is required.
      Returns:
      this
    • assignIpv6AddressOnCreation

      @Stability(Experimental) public SubnetV2.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation)
      (experimental) Indicates whether a network interface created in this subnet receives an IPv6 address.

      If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.

      Default: - undefined in case not provided as an input

      Parameters:
      assignIpv6AddressOnCreation - Indicates whether a network interface created in this subnet receives an IPv6 address. This parameter is required.
      Returns:
      this
    • ipv6CidrBlock

      @Stability(Experimental) public SubnetV2.Builder ipv6CidrBlock(IpCidr ipv6CidrBlock)
      (experimental) Ipv6 CIDR Range for subnet.

      Default: - No Ipv6 address

      Parameters:
      ipv6CidrBlock - Ipv6 CIDR Range for subnet. This parameter is required.
      Returns:
      this
    • routeTable

      @Stability(Experimental) public SubnetV2.Builder routeTable(IRouteTable routeTable)
      (experimental) Custom Route for subnet.

      Default: - a default route table created

      Parameters:
      routeTable - Custom Route for subnet. This parameter is required.
      Returns:
      this
    • subnetName

      @Stability(Experimental) public SubnetV2.Builder subnetName(String subnetName)
      (experimental) Subnet name.

      Default: - provisioned with an autogenerated name by CDK

      Parameters:
      subnetName - Subnet name. This parameter is required.
      Returns:
      this
    • build

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