Interface SubnetSelection

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.543Z") @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") // NOTE: 'admin' is reserved by DocumentDB
                 .excludeCharacters("\"@/:") // optional, defaults to the set "\"@/" and is also used for eventually created rotations
                 .secretName("/myapp/mydocdb/masteruser")
                 .build())
         .instanceType(InstanceType.of(InstanceClass.R5, InstanceSize.LARGE))
         .vpcSubnets(SubnetSelection.builder()
                 .subnetType(SubnetType.PUBLIC)
                 .build())
         .vpc(vpc)
         .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

    • getSubnetName

      @Stability(Deprecated) @Deprecated @Nullable default String getSubnetName()
      Deprecated.
      Use subnetGroupName instead
      (deprecated) Alias for subnetGroupName.

      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.

    • 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_NAT (or ISOLATED or PUBLIC if there are no PRIVATE_WITH_NAT subnets)

    • builder

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