-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
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
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@rix0rrr any feedback? |
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Could you please take a look into this PR? This is quite small changes that simplifies provision of PrivateSubnets. |
There was a problem hiding this 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.
packages/@aws-cdk/aws-ec2/lib/nat.ts
Outdated
@@ -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 }; |
There was a problem hiding this comment.
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).
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. |
Pull request has been modified.
@rix0rrr I've adjusted PR based on your suggestion. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Hmm, Do you know why Lambda breaks it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
💃 Nice! Thank you a lot for support and valuable feedback. |
closes #4858