interface SelectedSubnets
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.SelectedSubnets |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#SelectedSubnets |
Java | software.amazon.awscdk.services.ec2.SelectedSubnets |
Python | aws_cdk.aws_ec2.SelectedSubnets |
TypeScript (source) | aws-cdk-lib » aws_ec2 » SelectedSubnets |
Obtainable from
Vpc
.selectSubnets()
, Vpc
.selectSubnets()
Result of selecting a subset of subnets from a VPC.
Example
const vpc = new ec2.Vpc(this, 'TheVPC', {
ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16'),
})
// Iterate the private subnets
const selection = vpc.selectSubnets({
subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS
});
for (const subnet of selection.subnets) {
// ...
}
Properties
Name | Type | Description |
---|---|---|
availability | string[] | The respective AZs of each subnet. |
has | boolean | Whether any of the given subnets are from the VPC's public subnets. |
internet | IDependable | Dependency representing internet connectivity for these subnets. |
subnet | string[] | The subnet IDs. |
subnets | ISubnet [] | Selected subnet objects. |
is | boolean | The subnet selection is not actually real yet. |
availabilityZones
Type:
string[]
The respective AZs of each subnet.
hasPublic
Type:
boolean
Whether any of the given subnets are from the VPC's public subnets.
internetConnectivityEstablished
Type:
IDependable
Dependency representing internet connectivity for these subnets.
subnetIds
Type:
string[]
The subnet IDs.
subnets
Type:
ISubnet
[]
Selected subnet objects.
isPendingLookup?
Type:
boolean
(optional, default: false)
The subnet selection is not actually real yet.
If this value is true, don't validate anything about the subnets. The count or identities are not known yet, and the validation will most likely fail which will prevent a successful lookup.