-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aws-ec2] Allow including/excluding availability zones based on AZ Id #8972
Comments
We are aware of this issue, but thanks for reporting. For my edification--feels like it should be possible to put the physical AZ ids directly into the template. Is that not true? |
Hi Rico, Looking at the official CF docs for Subnets and parameters, there are no mentions of AZ IDs so it seem CF works only with AZ names (
The following links imply the same: I might be able to use the AWS SDK to call DescribeSubnets for the default VPC, and extract the mapping between AZ names and IDs - haven't tried it yet though. |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I think this is an issue worth keeping open. The work arounds are fairly cumbersome. |
Following up on this -- CFN now supports AvailabilityZoneId for subnets - https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ec2.CfnSubnet.html. This should be possible to support now. |
Because Workspaces is not available in certain AZs, redesigning my stack led to a chain reaction of dropping everything into Cfn methods - an exercise with errors I am still slogging through - and completely negated the utility of the CDK. If CDK supported this natively all this pain would be resolved. |
@gravitylow just read your comment above. How could the subnet be used in CDK? |
Hi CDK team,
It would be great if you enable us to supply a list of included/excluded AZs (based on AZ id, not name) when a VPC or any other resource that requires a subnet selection is created (for instance, an EKS cluster).
A viable alternative would be to expose the AZ IDs filed on subnets, so we can manually filter unwanted subnets.
Use Case
I have a use case where I need to create an EKS cluster with worker nodes in every available AZ. When I try to deploy my stacks, I get an
UnsupportedAvailabilityZoneException
stating there aren't enough compute resources in one of the supplied AZs. This is a fairly common issue with EKS (example 1, example 2), and you can usually work around it by omitting the subnets mapped to the problematic AZ.As the AZ names get shuffled for every AWS account, that workaround doesn't scale if you need to create a big number of clusters spread across a lot of AWS accounts.
My current workaround is to maintain a map of unsupported AZs for every AWS account that I have:
The awful thing about this is that I first need to fail in order to figure out the problematic subnet/AZ for each new account, adjust the mapping, have the change reviewed, deployed etc.
Proposed Solution
SubnetSelection
withavailabilityZoneIds()
so that resources aren't placed in unwanted AZs.An alternative would be to expose
getAvailabilityZoneId()
on theISubnet
interface. With it, we'd be able to manually filter out unwanted AZs before an EKS cluster is created. It would simplify maintenance because theACCOUNT_ID_TO_UNSUPPORTED_AZ
map from the example above could be simplified to something likeUNSUPPORTED_AZS = ['use1-az3',...]
.Both proposals would increase developer velocity as the fail-adjust-review-deploy cycle would be avoided.
Other
The following comment suggests the same feature:
#5927 (comment)
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: