Interface SubnetSelection

All Superinterfaces:
All Known Implementing Classes:

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-24T02:42:37.259Z") @Stability(Stable) public interface SubnetSelection extends
Customize subnets that are selected for placement of ENIs.

Constructs that allow customization of VPC placement use parameters of this type to provide placement settings.

By default, the instances are placed in the private subnets.


 Vpc vpc;
 DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database")
         .instanceType(InstanceType.of(InstanceClass.MEMORY5, InstanceSize.LARGE))
  • Method Details

    • getAvailabilityZones

      @Stability(Stable) @Nullable default List<String> getAvailabilityZones()
      Select subnets only in the given AZs.

      Default: no filtering on AZs is done

    • getOnePerAz

      @Stability(Stable) @Nullable default Boolean getOnePerAz()
      If true, return at most one subnet per AZ.

      Default: false

    • getSubnetFilters

      @Stability(Stable) @Nullable default List<SubnetFilter> getSubnetFilters()
      List of provided subnet filters.

      Default: - none

    • getSubnetGroupName

      @Stability(Stable) @Nullable default String getSubnetGroupName()
      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.

      Default: - Selection by type instead of by name

    • getSubnets

      @Stability(Stable) @Nullable default List<ISubnet> getSubnets()
      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.

      Default: - Use all subnets in a selected group (all private subnets by default)

    • getSubnetType

      @Stability(Stable) @Nullable default SubnetType getSubnetType()
      Select all subnets of the given type.

      At most one of subnetType and subnetGroupName can be supplied.

      Default: SubnetType.PRIVATE_WITH_EGRESS (or ISOLATED or PUBLIC if there are no PRIVATE_WITH_EGRESS subnets)

    • builder

      @Stability(Stable) static SubnetSelection.Builder builder()
      a SubnetSelection.Builder of SubnetSelection