Skip to content
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

vpc: make subnet IP allocation pluggable #7073

Closed
phaniram opened this issue Mar 30, 2020 · 4 comments
Closed

vpc: make subnet IP allocation pluggable #7073

phaniram opened this issue Mar 30, 2020 · 4 comments
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1

Comments

@phaniram
Copy link

Usecase is to be able to expand to multiple AZs in future. Ex: VPC can be first created only in one AZ, and later requires it to be available in few more AZs, without the Subnets going through ip re-numbering.

Currently we can have maxAZs : https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html#maxazs to have subnets in all available AZs in the system.

const vpc = new ec2.Vpc(this, 'Vpc', {
   cidr: '10.0.0.0/16',
    maxAzs: props.stage == 'prod' ? 99 : 1,
    natGateways: 1
});

and also use following

https://docs.aws.amazon.com/cdk/api/latest/docs/aws-ec2-readme.html#reserving-subnet-ip-space

to reserve subnet ip-space.

What would be ideal is to also reserve the ip space across AZs.

Currently if someone have to

  • Increase maxAZs

or

Subnets will get IP Renumbered and is treated as a replacement and when there're dependent resources it fails.

Another way is to swap VPC, but it is not really easy to just swap, and requires a lot of tweaks, hacks, workarounds, and a nightmare procedure.

Reproduction Steps

Error Log

Environment

  • CLI Version :
  • Framework Version:
  • OS :
  • Language :

Other


This is 🐛 Bug Report

@phaniram phaniram added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 30, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Mar 30, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 31, 2020

I think I see what you're saying.

Feels like the best forward-looking solution here is to have a pluggable component called IAddressSpaceAllocator (or similar) which is responsible for allocating IP space, and everyone can plug in their own implementation if they need something different from the defaults.

@rix0rrr rix0rrr added feature-request A feature should be added or improved. and removed bug This issue is a bug. labels Mar 31, 2020
@rix0rrr rix0rrr changed the title maxAZs to work with future availabilityZones vpc: make subnet IP allocation pluggable Mar 31, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Apr 16, 2020

Somewhat related to #5927

@rix0rrr rix0rrr added the effort/medium Medium work item – several days of effort label Apr 16, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label May 19, 2020
@johnschultz
Copy link

Another use case here is when creating VPCs in separate accounts in which services are supposed to communicate via PrivateLink.

For example, if you deploy to us-east-1 with maxAzs=3 then it is entirely possible for two VPCs in separate accounts to be unable to form PrivateLink connections. This is due to PrivateLinks being intra-AZ only and how logical AZ names are randomized across physical AZs on a per account basis.

@github-actions
Copy link

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.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

No branches or pull requests

4 participants