Class CfnSubnetProps.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • vpcId

      @Stability(Stable) public CfnSubnetProps.Builder vpcId(String vpcId)
      Sets the value of CfnSubnetProps.getVpcId()
      Parameters:
      vpcId - The ID of the VPC the subnet is in. This parameter is required. If you update this property, you must also update the CidrBlock property.
      Returns:
      this
    • assignIpv6AddressOnCreation

      @Stability(Stable) public CfnSubnetProps.Builder assignIpv6AddressOnCreation(Boolean assignIpv6AddressOnCreation)
      Parameters:
      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 an IPv6 CIDR block.
      Returns:
      this
    • assignIpv6AddressOnCreation

      @Stability(Stable) public CfnSubnetProps.Builder assignIpv6AddressOnCreation(IResolvable assignIpv6AddressOnCreation)
      Parameters:
      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 an IPv6 CIDR block.
      Returns:
      this
    • availabilityZone

      @Stability(Stable) public CfnSubnetProps.Builder availabilityZone(String availabilityZone)
      Parameters:
      availabilityZone - The Availability Zone of the subnet. If you update this property, you must also update the CidrBlock property.
      Returns:
      this
    • availabilityZoneId

      @Stability(Stable) public CfnSubnetProps.Builder availabilityZoneId(String availabilityZoneId)
      Parameters:
      availabilityZoneId - The AZ ID of the subnet.
      Returns:
      this
    • cidrBlock

      @Stability(Stable) public CfnSubnetProps.Builder cidrBlock(String cidrBlock)
      Parameters:
      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.
      Returns:
      this
    • enableDns64

      @Stability(Stable) public CfnSubnetProps.Builder enableDns64(Boolean enableDns64)
      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. For more information, see DNS64 and NAT64 in the Amazon Virtual Private Cloud User Guide .
      Returns:
      this
    • enableDns64

      @Stability(Stable) public CfnSubnetProps.Builder enableDns64(IResolvable enableDns64)
      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. For more information, see DNS64 and NAT64 in the Amazon Virtual Private Cloud User Guide .
      Returns:
      this
    • enableLniAtDeviceIndex

      @Stability(Stable) public CfnSubnetProps.Builder enableLniAtDeviceIndex(Number enableLniAtDeviceIndex)
      Parameters:
      enableLniAtDeviceIndex - Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1).
      Returns:
      this
    • ipv4IpamPoolId

      @Stability(Stable) public CfnSubnetProps.Builder ipv4IpamPoolId(String ipv4IpamPoolId)
      Parameters:
      ipv4IpamPoolId - An IPv4 IPAM pool ID for the subnet.
      Returns:
      this
    • ipv4NetmaskLength

      @Stability(Stable) public CfnSubnetProps.Builder ipv4NetmaskLength(Number ipv4NetmaskLength)
      Parameters:
      ipv4NetmaskLength - An IPv4 netmask length for the subnet.
      Returns:
      this
    • ipv6CidrBlock

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

      @Stability(Stable) public CfnSubnetProps.Builder ipv6CidrBlocks(List<String> ipv6CidrBlocks)
      Parameters:
      ipv6CidrBlocks - The IPv6 network ranges for the subnet, in CIDR notation.
      Returns:
      this
    • ipv6IpamPoolId

      @Stability(Stable) public CfnSubnetProps.Builder ipv6IpamPoolId(String ipv6IpamPoolId)
      Parameters:
      ipv6IpamPoolId - An IPv6 IPAM pool ID for the subnet.
      Returns:
      this
    • ipv6Native

      @Stability(Stable) public CfnSubnetProps.Builder ipv6Native(Boolean ipv6Native)
      Parameters:
      ipv6Native - Indicates whether this is an IPv6 only subnet. For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .
      Returns:
      this
    • ipv6Native

      @Stability(Stable) public CfnSubnetProps.Builder ipv6Native(IResolvable ipv6Native)
      Parameters:
      ipv6Native - Indicates whether this is an IPv6 only subnet. For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .
      Returns:
      this
    • ipv6NetmaskLength

      @Stability(Stable) public CfnSubnetProps.Builder ipv6NetmaskLength(Number ipv6NetmaskLength)
      Parameters:
      ipv6NetmaskLength - An IPv6 netmask length for the subnet.
      Returns:
      this
    • mapPublicIpOnLaunch

      @Stability(Stable) public CfnSubnetProps.Builder mapPublicIpOnLaunch(Boolean mapPublicIpOnLaunch)
      Parameters:
      mapPublicIpOnLaunch - Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is false . AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the VPC pricing page .
      Returns:
      this
    • mapPublicIpOnLaunch

      @Stability(Stable) public CfnSubnetProps.Builder mapPublicIpOnLaunch(IResolvable mapPublicIpOnLaunch)
      Parameters:
      mapPublicIpOnLaunch - Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is false . AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the VPC pricing page .
      Returns:
      this
    • outpostArn

      @Stability(Stable) public CfnSubnetProps.Builder outpostArn(String outpostArn)
      Parameters:
      outpostArn - The Amazon Resource Name (ARN) of the Outpost.
      Returns:
      this
    • privateDnsNameOptionsOnLaunch

      @Stability(Stable) public CfnSubnetProps.Builder privateDnsNameOptionsOnLaunch(Object privateDnsNameOptionsOnLaunch)
      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. 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)
      Returns:
      this
    • tags

      @Stability(Stable) public CfnSubnetProps.Builder tags(List<? extends CfnTag> tags)
      Sets the value of CfnSubnetProps.getTags()
      Parameters:
      tags - Any tags assigned to the subnet.
      Returns:
      this
    • build

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