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): natGateways=0 disables private subnets #8817

Merged
merged 7 commits into from Jul 1, 2020

Conversation

BryanPan342
Copy link
Contributor

@BryanPan342 BryanPan342 commented Jun 30, 2020

[ISSUE]
If natGateways: 0 in VPC but with no subnet configuration. If 0 NAT gateways, private subnets are effectively isolated subnets so it would be a nice-to-have to allow this configuration to construct without errors.

[APPROACH]
Added another default subnet configuration called DEFAULT_SUBNET_NO_NAT that does an even split of Public and Isolated Subnets.
Added a check before subnetConfiguration to determine which is 'default' configuration to use.

[NOTE]
Previous use cases should be untouched, changes adjust for our customers' requests to allow for easy configuration.

Closes #4814


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

@BryanPan342 BryanPan342 requested a review from rix0rrr June 30, 2020 21:25
@mergify
Copy link
Contributor

mergify bot commented Jun 30, 2020

Title does not follow the guidelines of Conventional Commits. Please adjust title before merge.

@BryanPan342 BryanPan342 changed the title feature(ec2): setting natGateways=0 blocks construction of VPC despite no subnet configuration feat(ec2): setting natGateways=0 blocks construction of VPC despite no subnet configuration Jun 30, 2020
@BryanPan342
Copy link
Contributor Author

BryanPan342 commented Jun 30, 2020

[ACTIONABLES]

  • update README to fix PR linter issue
  • add an integ test

marked this as done after some thought because an integration test for an edge case like this wouldn't provide verify any more than a unit test. At the end of the day, the customer request is simply for another default configuration which can be verified through a unit test.

@BryanPan342 BryanPan342 changed the title feat(ec2): setting natGateways=0 blocks construction of VPC despite no subnet configuration feat(ec2): setting natGateways=0 w/ no subnet config blocks construction of VPC Jun 30, 2020
@BryanPan342 BryanPan342 added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jul 1, 2020
@shivlaks shivlaks changed the title feat(ec2): setting natGateways=0 w/ no subnet config blocks construction of VPC fix(ec2): setting natGateways=0 w/ no subnet config blocks construction of VPC Jul 1, 2020
@shivlaks shivlaks changed the title fix(ec2): setting natGateways=0 w/ no subnet config blocks construction of VPC feat(ec2): setting natGateways=0 w/ no subnet config blocks construction of VPC Jul 1, 2020
Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work!
some minor suggestions

packages/@aws-cdk/aws-ec2/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ec2/test/vpc.test.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ec2/test/vpc.test.ts Show resolved Hide resolved
packages/@aws-cdk/aws-ec2/lib/vpc.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed shivlaks’s stale review July 1, 2020 06:05

Pull request has been modified.

@shivlaks shivlaks added the pr/do-not-merge This PR should not be merged at this time. label Jul 1, 2020
Copy link
Contributor

@shivlaks shivlaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added do-not-merge so @rix0rrr also has a chance to review

@rix0rrr rix0rrr changed the title feat(ec2): setting natGateways=0 w/ no subnet config blocks construction of VPC feat(ec2): natGateways=0 disables private subnets Jul 1, 2020
@shivlaks shivlaks removed the pr/do-not-merge This PR should not be merged at this time. label Jul 1, 2020
@mergify
Copy link
Contributor

mergify bot commented Jul 1, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify
Copy link
Contributor

mergify bot commented Jul 1, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 7f432ff into aws:master Jul 1, 2020
@BryanPan342 BryanPan342 deleted the vpc branch September 8, 2020 18:35
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow zero natGateways in VPC construct without requiring a subnetConfiguration
4 participants