Class SubnetSelection.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • availabilityZones

      @Stability(Stable) public SubnetSelection.Builder availabilityZones(List<String> availabilityZones)
      Parameters:
      availabilityZones - Select subnets only in the given AZs.
      Returns:
      this
    • onePerAz

      @Stability(Stable) public SubnetSelection.Builder onePerAz(Boolean onePerAz)
      Parameters:
      onePerAz - If true, return at most one subnet per AZ.
      Returns:
      this
    • subnetFilters

      @Stability(Stable) public SubnetSelection.Builder subnetFilters(List<? extends SubnetFilter> subnetFilters)
      Parameters:
      subnetFilters - List of provided subnet filters.
      Returns:
      this
    • subnetGroupName

      @Stability(Stable) public SubnetSelection.Builder subnetGroupName(String subnetGroupName)
      Parameters:
      subnetGroupName - Select the subnet group with the given name. Select the subnet group with the given name. This only needs to be used if you have multiple subnet groups of the same type and you need to distinguish between them. Otherwise, prefer subnetType.

      This field does not select individual subnets, it selects all subnets that share the given subnet group name. This is the name supplied in subnetConfiguration.

      At most one of subnetType and subnetGroupName can be supplied.

      Returns:
      this
    • subnets

      @Stability(Stable) public SubnetSelection.Builder subnets(List<? extends ISubnet> subnets)
      Parameters:
      subnets - Explicitly select individual subnets. Use this if you don't want to automatically use all subnets in a group, but have a need to control selection down to individual subnets.

      Cannot be specified together with subnetType or subnetGroupName.

      Returns:
      this
    • subnetType

      @Stability(Stable) public SubnetSelection.Builder subnetType(SubnetType subnetType)
      Parameters:
      subnetType - Select all subnets of the given type. At most one of subnetType and subnetGroupName can be supplied.
      Returns:
      this
    • build

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