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

Enable use of existing subnets #305

Merged
merged 4 commits into from
Nov 7, 2018
Merged

Enable use of existing subnets #305

merged 4 commits into from
Nov 7, 2018

Conversation

errordeveloper
Copy link
Contributor

@errordeveloper errordeveloper commented Nov 6, 2018

Description

This should sufficient to close #42 . As discussed in #303, there will be more logical features to add, but this should enable most folks.

This adds --vpc-{private,public}-subnets flags. It's entirely up to the user which ones they specify as private or public. This is very clearly defined in #303, but we need to come up with a concise statement to put in the docs. We also have a waning message now, to make sure we don't get too many bug reports because of bad VPC configurations, but we still need to make it crystal clear in the docs.

Checklist

  • Code compiles correctly (i.e make build)
  • All tests passing (i.e. make test)
  • Added/modified documentation as required (such as the README)

- refactor conditional logic for readability
- add more flag compatibility validation
- print warning to ensure that configuring the
  VPC and subnets is user's responsibility

for _, subnet := range output.Subnets {
if c.Spec.VPC.ID == "" {
c.Spec.VPC.ID = *subnet.VpcId
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also need to get the CIDR for the VPC (as DNS IP depends on this), and we already have them for each of the subnets too (so might as well set them here).

Copy link
Contributor

@richardcase richardcase left a comment

Choose a reason for hiding this comment

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

This looks good to be. I wonder if we need to think about refactoring (in general) in the future to start reducing the size of functions to make it cleaner and less complex.

@errordeveloper
Copy link
Contributor Author

errordeveloper commented Nov 7, 2018 via email

@errordeveloper errordeveloper changed the title WIP: Enable use of existing subnets Enable use of existing subnets Nov 7, 2018
@errordeveloper errordeveloper merged commit e3b8ecb into master Nov 7, 2018
@errordeveloper errordeveloper deleted the subnets branch November 7, 2018 10:07
@richardcase
Copy link
Contributor

Having said that, maybe a good idea to go with a follow-up PR rather then jamming everything into this one.

I'd agree, generally a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can use existing vpc and subnets
2 participants