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): Custom CfnVPC resource creation #13244

Closed

Conversation

flemjame-at-amazon
Copy link
Contributor

This extracts the CfnVPC resource creation into an IVpcResourceCreator, allowing the user to provide their own implementation if so desired. The default logic has also been encapsulated in a DefaultVpcResourceCreator class which more or less does what happens today. It also adds support for creation of secondary CIDR blocks.

This is an attempt to start remedying user requests such as #5927 which request greater control over how the VPC creates its resources. This PR is an example of a way to fix the problem -- allow the VPC to accept implementations of resource creation (e.g. the VPC, Subnets, Route Tables, and more) and simply execute them. It also will make the VPC class smaller by splitting its logic up into smaller classes.

new Vpc(stack, 'VPC', {
  vpcResourceCreator: myResourceCreator
});

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

@gitpod-io
Copy link

gitpod-io bot commented Feb 24, 2021

@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Feb 24, 2021
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 1f1fd1f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

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.

It's an interesting strategy.

For now, I honestly don't think we're going to accept any more incremental changes to VPCs in order for people to get it to do "their thing" with juuuust this one change.

VPCs are going to get a complete rework from the ground up at some point.

In the mean time, you are free and very welcome to start your own competing VPC construct with all the flexibility you need in a 3rd party construct library. In fact I'd encourage it! As long as your class implements IVpc, it will interoperate with all places in the CDK where a VPC is needed.

We can then evaluate competing designs that are used in production, rather than speculative changes added incrementally that just keep accreting features and changes in the hope they'll be flexible enough.

@MentalPower
Copy link

@rix0rrr there have been quite a few requests from "the community" and none have been entertained. What's the next step here? We've provided alternatives only for all of them to be shut down. Can we at least agree on a process to improve the Vpc class?

@mrpackethead
Copy link

@rix0rrr , this ones really quite critical. CDK is sold as a community project and a a lot of people are contributing, this one keeps coming up repeatably. But it seems its being put off all the time. Vpcs are the core to so many things, and not having these features really depowers CDK significantly.

@mrpackethead
Copy link

As long as your class implements IVpc, it will interoperate with all places in the CDK where a VPC is needed.

Can you point me at were IVpc is?

@skinny85
Copy link
Contributor

As long as your class implements IVpc, it will interoperate with all places in the CDK where a VPC is needed.

Can you point me at were IVpc is?

https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html

@rix0rrr rix0rrr removed their assignment Jun 22, 2021
@flemjame-at-amazon flemjame-at-amazon deleted the flexible-vpc branch July 29, 2021 17:21
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.

6 participants