Interface SubnetSelection
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
SubnetSelection.Jsii$Proxy
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();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forSubnetSelection
static final class
An implementation forSubnetSelection
-
Method Summary
Modifier and TypeMethodDescriptionstatic SubnetSelection.Builder
builder()
Select subnets only in the given AZs.default Boolean
If true, return at most one subnet per AZ.default List<SubnetFilter>
List of provided subnet filters.default String
Select the subnet group with the given name.Explicitly select individual subnets.default SubnetType
Select all subnets of the given type.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAvailabilityZones
Select subnets only in the given AZs.Default: no filtering on AZs is done
-
getOnePerAz
If true, return at most one subnet per AZ.Default: false
-
getSubnetFilters
List of provided subnet filters.Default: - none
-
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
andsubnetGroupName
can be supplied.Default: - Selection by type instead of by name
-
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
orsubnetGroupName
.Default: - Use all subnets in a selected group (all private subnets by default)
-
getSubnetType
Select all subnets of the given type.At most one of
subnetType
andsubnetGroupName
can be supplied.Default: SubnetType.PRIVATE_WITH_EGRESS (or ISOLATED or PUBLIC if there are no PRIVATE_WITH_EGRESS subnets)
-
builder
- Returns:
- a
SubnetSelection.Builder
ofSubnetSelection
-