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

[module/vpc] Allow for finer grained VPC configuration #65

Merged
merged 2 commits into from
Apr 29, 2022

Conversation

jrsdav
Copy link
Contributor

@jrsdav jrsdav commented Apr 26, 2022

Fixes #63

Motivation

Our VPC module is quite opinionated. In particular, only a /16 CIDR is valid for the VPC configuration, using anything else would throw a validation error. Also, the binary math was static in computing the generated subnets, so if you were able to create a /20 VPC, the corresponding subnets would use a /28 prefix.

Modifications

Added a new input variable called subnet_newbits. Using this, you can specify the number of bits to add to the base CIDR to use for the subnets. So if you are using a /20, setting subnet_newbits = 4 will generate the subnets with a /24 prefix.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Documentation

Check the box below.

Need to update docs?

  • doc

@jrsdav jrsdav requested a review from a team as a code owner April 26, 2022 22:28
@jrsdav jrsdav requested a review from maxsxu April 26, 2022 22:28
@github-actions github-actions bot added the doc This pr contains a document label Apr 26, 2022
Copy link
Member

@maxsxu maxsxu left a comment

Choose a reason for hiding this comment

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

Generally LGTM.
@jrsdav Left a thought in the comment

modules/vpc/variables.tf Outdated Show resolved Hide resolved
@maxsxu maxsxu merged commit be5831b into master Apr 29, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/vpc_configuration branch April 29, 2022 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc This pr contains a document
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove VPC CIDR validation in vpc module
2 participants