Class CfnSubnet.Builder

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

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

    • create

      @Stability(Stable) public static CfnSubnet.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnSubnet.Builder.
    • vpcId

      @Stability(Stable) public CfnSubnet.Builder vpcId(String vpcId)
      The ID of the VPC the subnet is in.

      If you update this property, you must also update the CidrBlock property.

      Parameters:
      vpcId - The ID of the VPC the subnet is in. This parameter is required.
      Returns:
      this
    • assignIpv6AddressOnCreation

      @Stability(Stable) public CfnSubnet.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation)
      Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is false .

      If you specify AssignIpv6AddressOnCreation , you must also specify Ipv6CidrBlock .

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

      @Stability(Stable) public CfnSubnet.Builder assignIpv6AddressOnCreation(IResolvable assignIpv6AddressOnCreation)
      Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is false .

      If you specify AssignIpv6AddressOnCreation , you must also specify Ipv6CidrBlock .

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

      @Stability(Stable) public CfnSubnet.Builder availabilityZone(String availabilityZone)
      The Availability Zone of the subnet.

      If you update this property, you must also update the CidrBlock property.

      Parameters:
      availabilityZone - The Availability Zone of the subnet. This parameter is required.
      Returns:
      this
    • availabilityZoneId

      @Stability(Stable) public CfnSubnet.Builder availabilityZoneId(String availabilityZoneId)
      The AZ ID of the subnet.

      Parameters:
      availabilityZoneId - The AZ ID of the subnet. This parameter is required.
      Returns:
      this
    • cidrBlock

      @Stability(Stable) public CfnSubnet.Builder cidrBlock(String cidrBlock)
      The IPv4 CIDR block assigned to the subnet.

      If you update this property, we create a new subnet, and then delete the existing one.

      Parameters:
      cidrBlock - The IPv4 CIDR block assigned to the subnet. This parameter is required.
      Returns:
      this
    • enableDns64

      @Stability(Stable) public CfnSubnet.Builder enableDns64(Boolean enableDns64)
      Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.

      For more information, see DNS64 and NAT64 in the Amazon Virtual Private Cloud User Guide .

      Parameters:
      enableDns64 - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. This parameter is required.
      Returns:
      this
    • enableDns64

      @Stability(Stable) public CfnSubnet.Builder enableDns64(IResolvable enableDns64)
      Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.

      For more information, see DNS64 and NAT64 in the Amazon Virtual Private Cloud User Guide .

      Parameters:
      enableDns64 - Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. This parameter is required.
      Returns:
      this
    • ipv6CidrBlock

      @Stability(Stable) public CfnSubnet.Builder ipv6CidrBlock(String ipv6CidrBlock)
      The IPv6 CIDR block.

      If you specify AssignIpv6AddressOnCreation , you must also specify Ipv6CidrBlock .

      Parameters:
      ipv6CidrBlock - The IPv6 CIDR block. This parameter is required.
      Returns:
      this
    • ipv6Native

      @Stability(Stable) public CfnSubnet.Builder ipv6Native(Boolean ipv6Native)
      Indicates whether this is an IPv6 only subnet.

      For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .

      Parameters:
      ipv6Native - Indicates whether this is an IPv6 only subnet. This parameter is required.
      Returns:
      this
    • ipv6Native

      @Stability(Stable) public CfnSubnet.Builder ipv6Native(IResolvable ipv6Native)
      Indicates whether this is an IPv6 only subnet.

      For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .

      Parameters:
      ipv6Native - Indicates whether this is an IPv6 only subnet. This parameter is required.
      Returns:
      this
    • mapPublicIpOnLaunch

      @Stability(Stable) public CfnSubnet.Builder mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)
      Indicates whether instances launched in this subnet receive a public IPv4 address.

      The default value is false .

      Parameters:
      mapPublicIpOnLaunch - Indicates whether instances launched in this subnet receive a public IPv4 address. This parameter is required.
      Returns:
      this
    • mapPublicIpOnLaunch

      @Stability(Stable) public CfnSubnet.Builder mapPublicIpOnLaunch(IResolvable mapPublicIpOnLaunch)
      Indicates whether instances launched in this subnet receive a public IPv4 address.

      The default value is false .

      Parameters:
      mapPublicIpOnLaunch - Indicates whether instances launched in this subnet receive a public IPv4 address. This parameter is required.
      Returns:
      this
    • outpostArn

      @Stability(Stable) public CfnSubnet.Builder outpostArn(String outpostArn)
      The Amazon Resource Name (ARN) of the Outpost.

      Parameters:
      outpostArn - The Amazon Resource Name (ARN) of the Outpost. This parameter is required.
      Returns:
      this
    • privateDnsNameOptionsOnLaunch

      @Stability(Stable) public CfnSubnet.Builder privateDnsNameOptionsOnLaunch(Object privateDnsNameOptionsOnLaunch)
      The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries to the instances should be handled.

      For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .

      Available options:

      • EnableResourceNameDnsAAAARecord (true | false)
      • EnableResourceNameDnsARecord (true | false)
      • HostnameType (ip-name | resource-name)

      Parameters:
      privateDnsNameOptionsOnLaunch - The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries to the instances should be handled. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnSubnet.Builder tags(List<? extends CfnTag> tags)
      Any tags assigned to the subnet.

      Parameters:
      tags - Any tags assigned to the subnet. This parameter is required.
      Returns:
      this
    • build

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