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

feat(ec2): allow filtering out exhausted subnets during subnet selection #8311

Closed
wants to merge 3 commits into from
Closed

feat(ec2): allow filtering out exhausted subnets during subnet selection #8311

wants to merge 3 commits into from

Conversation

gradybarrett
Copy link

@gradybarrett gradybarrett commented Jun 1, 2020

When selecting subnets using SubnetSelection it's useful to be able to filter out those subnets with 0 available IP addresses (IP "exhausted" subnets) that may exist in subnet groups where the remaining subnets have adequate IP space. In doing so we can avoid trying to use these subnets.

For example a DBCluster that may try to create an instance in an exhausted Subnet during a scaling event.

As I said in #8310, I'm quite new to both the CDK codebase and Typescript, so I am looking at this as a learning experience. Apologies in advance for any egregious sins I've committed.

I've added both a simple unit test and integration tests, which alongside the other tests, should validate that this is not a breaking change, and show successful filtering of Subnets with 0 available IP addresses when the appropriate SubnetSelection option is supplied.

Closes #8310.

TODO:

  • Update any readme's (ec2) + other doc updates I may have missed (?)
  • Test helper function cleanup if needed. I may have gotten a bit function-happy...
  • Not sure if I should have committed the yarn.lock or not. Edit: I've removed it for now to make keeping this branch up to date easier.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

A subnet's AvailableIpAddressCount is made available during vpc lookup.
This change just exposes it, if available, for use later down the road
for purposes such as filtering subnets during Subnet selection.

closes #8310
When providing SubnetSelection it's useful to ignore Subnets in a
selected subnet group that have 0 available IPs, since we generally
wouldn't want to try to deploy to those subnets.

For example if we have a subnet group with 4 subnets, 3 of which have
sufficient IP space: this is the case in our organization.

closes #8310
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 8d694c8
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@gradybarrett
Copy link
Author

Holding off on Readme changes until I get feedback on the feature.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: b500fc9
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: bcaad5d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@gradybarrett gradybarrett deleted the gradybarrett/filter-out-exhausted-subnets-during-selection branch June 8, 2020 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow filtering out IP exhausted Subnets during subnet selection [ec2, rds, VpcLookup] - SubnetSelection
3 participants