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
Hello there! I created a Managed Instance Group with module 11.1.0. After that, I use update_policy to add configuration for rolling update policy.
update_policy
terraform plan must trigger changes and show changes for update_policy.
terraform plan
Get the error:
Error: Invalid value for input variable │ │ on main.tf line 71, in module "mig": │ 71: update_policy = [ │ 72: { │ 73: type = "PROACTIVE" │ 74: instance_redistribution_type = "PROACTIVE" │ 75: minimal_action = "REPLACE" │ 76: most_disruptive_allowed_action = "REPLACE" │ 77: max_unavailable_fixed = 1 │ 78: max_surge_fixed = 1 │ 79: replacement_method = "SUBSTITUTE" │ 80: } │ 81: ] │ │ The given value is not suitable for module.nonprod_carbon_sunup_mig.var.update_policy declared at .terraform/modules/mig/modules/mig/variables.tf:100,1-25: element 0: attributes "max_surge_percent", │ "max_unavailable_percent", and "min_ready_sec" are required.
update_policy variable is defined as:
variable "update_policy" { description = "The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy" type = list(object({ max_surge_fixed = number instance_redistribution_type = string max_surge_percent = number max_unavailable_fixed = number max_unavailable_percent = number min_ready_sec = number replacement_method = string minimal_action = string type = string most_disruptive_allowed_action = string })) default = [] }
It means that this variable expects the list of maps where each map contains all these keys. With respect to the documentation https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_region_instance_group_manager#nested_update_policy we cannot define all keys simultaneously because some of them have conflicts with each other.
module "mig" { source = "terraform-google-modules/vm/google//modules/mig" version = "11.1.0" instance_template = google_compute_instance_template.test_template.self_link region = "us-central1" project_id = "test-project" hostname = "test-hostname" target_size = 2 distribution_policy_zones = ["us-central1-a", "us-central1-f"] named_ports = [ { name = "http" port = 80 } ] update_policy = [ { type = "PROACTIVE" instance_redistribution_type = "PROACTIVE" minimal_action = "REPLACE" most_disruptive_allowed_action = "REPLACE" max_unavailable_fixed = 1 max_surge_fixed = 1 replacement_method = "SUBSTITUTE" } ] }
v1.4.7
No response
The text was updated successfully, but these errors were encountered:
TL;DR
Hello there!
I created a Managed Instance Group with module 11.1.0.
After that, I use
update_policy
to add configuration for rolling update policy.Expected behavior
terraform plan
must trigger changes and show changes forupdate_policy
.Observed behavior
Get the error:
update_policy
variable is defined as:It means that this variable expects the list of maps where each map contains all these keys.
With respect to the documentation https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_region_instance_group_manager#nested_update_policy we cannot define all keys simultaneously because some of them have conflicts with each other.
Terraform Configuration
Terraform Version
Additional information
No response
The text was updated successfully, but these errors were encountered: