aws_cdk.aws_ec2.Vpc: max_a_zs ignored? #3110
Labels
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
needs-reproduction
This issue needs reproduction.
package/tools
Related to AWS CDK Tools or CLI
I'm submitting a ...
What is the current behavior?
For the code below, it seems as if the synthesized template includes only 4 subnets (2 public and 2 private) even if
max_a_zs
value and subnet configuration would allow for more in the affected region.If the current behavior is a πͺ²bugπͺ²: Please provide the steps to reproduce
Consider this code:
Then, run the CLI like so:
$ cdk synth --json | jq '.Resources | to_entries | [.[] | select(.value.Type == "AWS::EC2::Subnet")] | length'
The jq filter simply counts subnet resources declared in the synthesized template.
Six subnets should have been created. I can't seem to create more than 4. Note that us-east-2 has at least 3 AZs. Also, I notice that no context values were saved by the CLI after a synth command.
I reviewed CHANGELOG.md and commits on master since v0.36.0 but didn't notice anything relevant. I feel like I may have missed something here (sincerest apologies if so), as this kind of issue seems fairly easy to encounter, so I'd be surprised somewhat if indeed this is a bug and I am the first to report it.
What is the motivation / use case for changing the behavior or adding this feature?
I'd like to create more than 4 subnets and preserve my existing VPC stacks having more than 4 subnets. Unless I misunderstood something, I'm pretty sure this is a regression because I don't recall having such a problem in v0.34.0. When I run
cdk diff
from v0.36.0 against similar VPC stacks created by v0.34.0, results indicate a reduction to 4 subnets and change of the remaining subnets to a reduced CIDR prefix (quite disruptive).Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
The text was updated successfully, but these errors were encountered: