Interface SubnetSelection

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
SubnetSelection.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-24T02:42:37.259Z") @Stability(Stable) public interface SubnetSelection extends software.amazon.jsii.JsiiSerializable
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.

Example:

 Vpc vpc;
 DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "Database")
         .masterUser(Login.builder()
                 .username("myuser")
                 .build())
         .instanceType(InstanceType.of(InstanceClass.MEMORY5, InstanceSize.LARGE))
         .vpcSubnets(SubnetSelection.builder()
                 .subnetType(SubnetType.PUBLIC)
                 .build())
         .vpc(vpc)
         .removalPolicy(RemovalPolicy.SNAPSHOT)
         .instanceRemovalPolicy(RemovalPolicy.RETAIN)
         .build();
 
  • 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()
      Returns:
      a SubnetSelection.Builder of SubnetSelection