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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionavailabilityZones
(List<String> availabilityZones) Sets the value ofSubnetSelection.getAvailabilityZones()
build()
Builds the configured instance.Sets the value ofSubnetSelection.getOnePerAz()
subnetFilters
(List<? extends SubnetFilter> subnetFilters) Sets the value ofSubnetSelection.getSubnetFilters()
subnetGroupName
(String subnetGroupName) Sets the value ofSubnetSelection.getSubnetGroupName()
Sets the value ofSubnetSelection.getSubnets()
subnetType
(SubnetType subnetType) Sets the value ofSubnetSelection.getSubnetType()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
availabilityZones
Sets the value ofSubnetSelection.getAvailabilityZones()
- Parameters:
availabilityZones
- Select subnets only in the given AZs.- Returns:
this
-
onePerAz
Sets the value ofSubnetSelection.getOnePerAz()
- Parameters:
onePerAz
- If true, return at most one subnet per AZ.- Returns:
this
-
subnetFilters
@Stability(Stable) public SubnetSelection.Builder subnetFilters(List<? extends SubnetFilter> subnetFilters) Sets the value ofSubnetSelection.getSubnetFilters()
- Parameters:
subnetFilters
- List of provided subnet filters.- Returns:
this
-
subnetGroupName
Sets the value ofSubnetSelection.getSubnetGroupName()
- 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, prefersubnetType
.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.- Returns:
this
-
subnets
Sets the value ofSubnetSelection.getSubnets()
- 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
orsubnetGroupName
.- Returns:
this
-
subnetType
Sets the value ofSubnetSelection.getSubnetType()
- Parameters:
subnetType
- Select all subnets of the given type. At most one ofsubnetType
andsubnetGroupName
can be supplied.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SubnetSelection>
- Returns:
- a new instance of
SubnetSelection
- Throws:
NullPointerException
- if any required attribute was not provided
-