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

implement the mig_with_percent submodule #19

Merged
merged 5 commits into from Aug 13, 2019
Merged

implement the mig_with_percent submodule #19

merged 5 commits into from Aug 13, 2019

Conversation

namusyaka
Copy link
Contributor

@morgante This is a first try to implement the pvm with percent on mig module. I believe we can discuss our design based on these changes.

@namusyaka namusyaka requested a review from morgante July 22, 2019 10:14
@aaron-lane aaron-lane added the enhancement New feature or request label Jul 22, 2019
Copy link
Contributor

@aaron-lane aaron-lane left a comment

Choose a reason for hiding this comment

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

Thanks, @namusyaka!

Example modules should not be nested within each other; the Terraform registry only recognizes the modules directly under examples.

examples/mig_with_percent/simple/main.tf Outdated Show resolved Hide resolved
description = "The GCP region where the managed instance group resides."
}

variable "instance_template_version0" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there more descriptive names for the two template groups rather than 0 and 1? Regardless, the names should be delimited like version_0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to initial_version and next_version. Any ideas?

target_size = "${var.target_size}"
hostname = "mig-with-percent-simple"
instance_template_version0 = "${module.instance_template.self_link}"
instance_template_version1 = "${module.instance_template.another_self_link}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This output is undefined. Similar to the inputs, I suggest we find more meaningful names to differentiate the two self links, like regular_self_link and preemptible_self_link.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep the regular self_link as self_link but give preemptible a descriptive name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm thinking this should have regular prefix or not. In my opinion, we can have the regular_ prefix for the consistency according to preemptible_and_regular_instance_templates.

examples/mig_with_percent/simple/variables.tf Outdated Show resolved Hide resolved
modules/mig_with_percent/README.md Show resolved Hide resolved
modules/mig_with_percent/README.md Outdated Show resolved Hide resolved
}
}

data "google_compute_zones" "available" {}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be configured with region = "${var.region}".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack, thanks for pointing this out.
This should also be updated, but I'll do that after merging this series.

@aaron-lane
Copy link
Contributor

@namusyaka as you pointed out, other examples in this repository have followed the same nesting pattern so you can keep it as is. The issue with this approach is that the Terraform Registry does not advertise any examples for this module 1 so we should address it in a different pull request.

@aaron-lane
Copy link
Contributor

Since this depends on #18, let's focus on finishing that review before continuing here.

@namusyaka
Copy link
Contributor Author

Sure.

@namusyaka namusyaka self-assigned this Aug 2, 2019
@namusyaka namusyaka changed the base branch from impl-two-its to master August 9, 2019 04:04
@namusyaka
Copy link
Contributor Author

Merged master into this branch and upgrade syntax to 0.12. PTAL.

@namusyaka
Copy link
Contributor Author

ping?

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

LGTM.

Note: we should probably look at having a script to generate the mig-with-percent and mig modules since they share most of their code.

@morgante morgante merged commit 12a3a17 into master Aug 13, 2019
@namusyaka namusyaka deleted the impl-per-mig branch August 14, 2019 10:20
aaron-lane added a commit that referenced this pull request Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants