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): access gateways created by NatProvider #4948

Merged
merged 13 commits into from
Nov 28, 2019

Conversation

fogfish
Copy link
Contributor

@fogfish fogfish commented Nov 11, 2019

closes #4858

@fogfish fogfish requested a review from rix0rrr as a code owner November 11, 2019 12:29
@mergify
Copy link
Contributor

mergify bot commented Nov 11, 2019

Thanks so much for taking the time to contribute to the AWS CDK ❤️

We will shortly assign someone to review this pull request and help get it
merged. In the meantime, please take a minute to make sure you follow this
checklist
:

  • PR title type(scope): text
    • type: fix, feat, refactor go into CHANGELOG, chore is hidden
    • scope: name of module without aws- or cdk- prefix or postfix (e.g. s3 instead of aws-s3-deployment)
    • text: use all lower-case, do not end with a period, do not include issue refs
  • PR Description
    • Rationale: describe rationale of change and approach taken
    • Issues: indicate issues fixed via: fixes #xxx or closes #xxx
    • Breaking?: last paragraph: BREAKING CHANGE: <describe what changed + link for details>
  • Testing
    • Unit test added. Prefer to add a new test rather than modify existing tests
    • CLI or init templates change? Re-run/add CLI integration tests
  • Documentation
    • README: update module README to describe new features
    • API docs: public APIs must be documented. Copy from official AWS docs when possible
    • Design: for significant features, follow design process

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • 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

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@fogfish
Copy link
Contributor Author

fogfish commented Nov 12, 2019

@rix0rrr any feedback?

@fogfish
Copy link
Contributor Author

fogfish commented Nov 18, 2019

It would be great to get any feedback on this pull request. This is fine, if you'd like to keep list of NATs private. In this case, we should start a work around project.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@fogfish
Copy link
Contributor Author

fogfish commented Nov 25, 2019

Could you please take a look into this PR? This is quite small changes that simplifies provision of PrivateSubnets.

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

We can totally add this to unblock you, modulo that I think the change should be completely in the NAT provider and not touch the VPC class at all. I'm thinking:

const natGatewayProvider = NatProvider.gateway();
new Vpc(..., { natGatewayProvider });
use(natGatewayProvider.gateways);

However, this is only one aspect. I bet there's also a more holistic change we can do to make the whole process of progressively adding subnets to a VPC more convenient. I'm not exactly sure what that would look like yet, but maybe we can design it together.

@@ -44,7 +44,7 @@ export abstract class NatProvider {
/**
* Called by the VPC to configure NAT
*/
public abstract configureNat(options: ConfigureNatOptions): void;
public abstract configureNat(options: ConfigureNatOptions): { [az: string]: string };
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of returning from this method, I think it makes more sense to store the information you're looking for on the object itself, and make it accessible using public getters.

When you do this, it's probably better to have a list of { az, router } records than a map. That will also allow future extensions where there is more than one router per AZ (which might be desirable for redundancy or performance).

@fogfish
Copy link
Contributor Author

fogfish commented Nov 26, 2019

Thank you very much for the comment! This is a really good idea to decouple Gateway Provider from VPC. You proposal looks very good. Let's re-work this pull request to address it.

@mergify mergify bot dismissed rix0rrr’s stale review November 27, 2019 11:56

Pull request has been modified.

@fogfish
Copy link
Contributor Author

fogfish commented Nov 27, 2019

@rix0rrr I've adjusted PR based on your suggestion.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: FAILED
  • 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

  • Result: FAILED
  • Build Logs (available for 30 days)

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

@fogfish
Copy link
Contributor Author

fogfish commented Nov 27, 2019

Hmm, Do you know why Lambda breaks it

@aws-cdk/aws-lambda... CHANGES.
Original assembly: @aws-cdk/aws-lambda@1.18.0
Updated assembly:  @aws-cdk/aws-lambda@1.16.1
API elements with incompatible changes:
err  - PROP @aws-cdk/aws-lambda.Runtime.JAVA_11: has been removed [removed:@aws-cdk/aws-lambda.Runtime.JAVA_11]
err  - PROP @aws-cdk/aws-lambda.Runtime.NODEJS_12_X: has been removed [removed:@aws-cdk/aws-lambda.Runtime.NODEJS_12_X]
err  - PROP @aws-cdk/aws-lambda.Runtime.PYTHON_3_8: has been removed [removed:@aws-cdk/aws-lambda.Runtime.PYTHON_3_8]

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

packages/@aws-cdk/aws-ec2/lib/nat.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ec2/lib/nat.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ec2/lib/nat.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-ec2/lib/nat.ts Show resolved Hide resolved
@mergify mergify bot dismissed rix0rrr’s stale review November 28, 2019 08:23

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • 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

  • Result: FAILED
  • 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

  • Result: FAILED
  • 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

  • Result: FAILED
  • 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

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label Nov 28, 2019
@rix0rrr rix0rrr changed the title Access to nat gw feat(ec2): access gateways created by NatProvider Nov 28, 2019
@rix0rrr rix0rrr merged commit 5907055 into aws:master Nov 28, 2019
@fogfish
Copy link
Contributor Author

fogfish commented Nov 28, 2019

💃

Nice! Thank you a lot for support and valuable feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/do-not-merge This PR should not be merged at this time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

attach private subnet to existing VPC
3 participants