-
Notifications
You must be signed in to change notification settings - Fork 140
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 VPC module to accept subnetwork_name input variable #285
Enable VPC module to accept subnetwork_name input variable #285
Conversation
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.
I have a usability suggestion.
I have made modification based on out-of-band conversation to re-work |
Build tests failed due to hitting an internal Filestore quota. Re-running them. GitHub should update once they complete. |
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.
a few more comments.
modules/network/vpc/variables.tf
Outdated
Primary (default) subnetwork in which to create resources. If null, a default value will be constructed. | ||
|
||
subnet_name (string, required, Name of subnet; will be replaced by var.subnetwork_name or its default value) | ||
subnet_region (string, requiered, will be replaced by var.region) |
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.
typo: requiered. :)
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.
Fixed.
modules/network/vpc/variables.tf
Outdated
purpose (string, optional, related to Load Balancing) | ||
role (string, optional, related to Load Balancing) | ||
subnet_name (string, required, Name of subnet; will be replaced by var.subnetwork_name or its default value) | ||
subnet_region (string, requiered, will be replaced by var.region) |
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.
same required typo here
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.
Fixed
* Re-work primary_subnetwork as an input variable that defaults to null. If no value is supplied, then a default is constructed in a local variable. If a value is supplied, then it is taken explicitly. * Construct local block from new input variables subnetwork_name and subnetwork_size. The former aligns with Toolkit naming conventions and simplifies multi-group blueprints when network_name and subnetwork_name are set as global variables. In particular, this allows the pre-existing-vpc module in group N to detect a VPC created by the vpc module in group M, where M < N.
* Adopt new feature in VPC module to allow explicit specification of both network_name and subnetwork_name; current image building example works because Packer template defaults to same subnetwork_name as VPC module
* The Packer template was previously designed to default to the same subnetwork_name as is created by the VPC module. This behavior was intentional to allow for more automatic harmony when a user creates a VPC without specifying a value. * This change intentionally requires the user to specify subnetwork_name. It is anticipated that the most common use case will be to specify subnetwork_name globally.
* Current solution relies on alignment of globally-set subnetwork_name with value created by VPC module. Updates to the VPC module no longer require this, so adopt a value that is more arbitrary.
Expose subnetwork_name as a top-level variable to the VPC module to allow multi-group blueprints to succeed when network_name and subnetwork_name are set as global variables. In particular, this allows the pre-existing-vpc module in group N to detect a VPC created by the vpc module in group M, where M < N.If no value is supplied, then a default is constructed in a local
variable. If a value is supplied, then it is taken explicitly.
subnetwork_size. The former aligns with Toolkit naming conventions and
simplifies multi-group blueprints when network_name and subnetwork_name
are set as global variables. In particular, this allows the
pre-existing-vpc module in group N to detect a VPC created by the vpc
module in group M, where M < N.
Submission Checklist
pre-commit install
make tests
change?
guides?