SubnetSelection

class aws_cdk.aws_ec2.SubnetSelection(*, one_per_az=None, subnet_group_name=None, subnet_name=None, subnets=None, subnet_type=None)

Bases: object

__init__(*, one_per_az=None, subnet_group_name=None, subnet_name=None, subnets=None, subnet_type=None)

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.

Parameters
  • one_per_az (Optional[bool]) – If true, return at most one subnet per AZ. Default: false

  • subnet_group_name (Optional[str]) – 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

  • subnet_name (Optional[str]) – 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.

  • subnets (Optional[List[ISubnet]]) – 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)

  • subnet_type (Optional[SubnetType]) – Select all subnets of the given type. At most one of subnetType and subnetGroupName can be supplied. Default: SubnetType.PRIVATE (or ISOLATED or PUBLIC if there are no PRIVATE subnets)

Attributes

one_per_az

If true, return at most one subnet per AZ.

default :default: false

Return type

Optional[bool]

subnet_group_name

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 :default: - Selection by type instead of by name

Return type

Optional[str]

subnet_name

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.

deprecated :deprecated: Use subnetGroupName instead

stability :stability: deprecated

Return type

Optional[str]

subnet_type

Select all subnets of the given type.

At most one of subnetType and subnetGroupName can be supplied.

default :default: SubnetType.PRIVATE (or ISOLATED or PUBLIC if there are no PRIVATE subnets)

Return type

Optional[SubnetType]

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 or subnetGroupName.

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

Return type

Optional[List[ISubnet]]