From 6769c24bc4b7b070bab8dee2c9a33fff1e0b9eb4 Mon Sep 17 00:00:00 2001 From: eeaton Date: Thu, 23 May 2024 19:42:35 +0100 Subject: [PATCH] fix(variables)!: allow optional attributes for update_policy object (#407) Co-authored-by: Andrew Peabody --- autogen/variables.tf.tmpl | 16 ++++++++-------- autogen/versions.tf.tmpl | 2 +- examples/mig/full/variables.tf | 16 ++++++++-------- modules/mig/README.md | 2 +- modules/mig/metadata.yaml | 18 +++++++++--------- modules/mig/variables.tf | 16 ++++++++-------- modules/mig/versions.tf | 2 +- modules/mig_with_percent/README.md | 2 +- modules/mig_with_percent/metadata.yaml | 18 +++++++++--------- modules/mig_with_percent/variables.tf | 16 ++++++++-------- modules/mig_with_percent/versions.tf | 2 +- 11 files changed, 55 insertions(+), 55 deletions(-) diff --git a/autogen/variables.tf.tmpl b/autogen/variables.tf.tmpl index 7589746a..324cb280 100644 --- a/autogen/variables.tf.tmpl +++ b/autogen/variables.tf.tmpl @@ -118,16 +118,16 @@ variable "stateful_ips" { 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 + max_surge_fixed = optional(number) + instance_redistribution_type = optional(string) + max_surge_percent = optional(number) + max_unavailable_fixed = optional(number) + max_unavailable_percent = optional(number) + min_ready_sec = optional(number) + replacement_method = optional(string) minimal_action = string type = string - most_disruptive_allowed_action = string + most_disruptive_allowed_action = optional(string) })) default = [] } diff --git a/autogen/versions.tf.tmpl b/autogen/versions.tf.tmpl index 5464f589..ace24c91 100644 --- a/autogen/versions.tf.tmpl +++ b/autogen/versions.tf.tmpl @@ -15,7 +15,7 @@ */ terraform { - required_version = ">=0.13.0" + required_version = ">=1.3.0" required_providers { google = { source = "hashicorp/google" diff --git a/examples/mig/full/variables.tf b/examples/mig/full/variables.tf index fb875961..c60a0c94 100644 --- a/examples/mig/full/variables.tf +++ b/examples/mig/full/variables.tf @@ -169,16 +169,16 @@ variable "distribution_policy_zones" { 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 + max_surge_fixed = optional(number) + instance_redistribution_type = optional(string) + max_surge_percent = optional(number) + max_unavailable_fixed = optional(number) + max_unavailable_percent = optional(number) + min_ready_sec = optional(number) + replacement_method = optional(string) minimal_action = string type = string - most_disruptive_allowed_action = string + most_disruptive_allowed_action = optional(string) })) default = [] } diff --git a/modules/mig/README.md b/modules/mig/README.md index 216bcaa3..baace6dc 100644 --- a/modules/mig/README.md +++ b/modules/mig/README.md @@ -45,7 +45,7 @@ The current version is 2.X. The following guides are available to assist with up | stateful\_ips | Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs |
list(object({
interface_name = string
delete_rule = string
is_external = bool
}))
| `[]` | no | | target\_pools | The target load balancing pools to assign this group to. | `list(string)` | `[]` | no | | target\_size | The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. | `number` | `1` | no | -| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
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
}))
| `[]` | no | +| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
list(object({
max_surge_fixed = optional(number)
instance_redistribution_type = optional(string)
max_surge_percent = optional(number)
max_unavailable_fixed = optional(number)
max_unavailable_percent = optional(number)
min_ready_sec = optional(number)
replacement_method = optional(string)
minimal_action = string
type = string
most_disruptive_allowed_action = optional(string)
}))
| `[]` | no | | wait\_for\_instances | Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. | `string` | `"false"` | no | ## Outputs diff --git a/modules/mig/metadata.yaml b/modules/mig/metadata.yaml index b53348a7..31fd6d7a 100644 --- a/modules/mig/metadata.yaml +++ b/modules/mig/metadata.yaml @@ -28,7 +28,7 @@ spec: version: 11.1.0 actuationTool: flavor: Terraform - version: ">=0.13.0" + version: ">=1.3.0" description: {} content: examples: @@ -257,16 +257,16 @@ spec: description: The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy varType: |- 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 + max_surge_fixed = optional(number) + instance_redistribution_type = optional(string) + max_surge_percent = optional(number) + max_unavailable_fixed = optional(number) + max_unavailable_percent = optional(number) + min_ready_sec = optional(number) + replacement_method = optional(string) minimal_action = string type = string - most_disruptive_allowed_action = string + most_disruptive_allowed_action = optional(string) })) defaultValue: [] - name: wait_for_instances diff --git a/modules/mig/variables.tf b/modules/mig/variables.tf index e440ee2e..42fd903f 100644 --- a/modules/mig/variables.tf +++ b/modules/mig/variables.tf @@ -100,16 +100,16 @@ variable "stateful_ips" { 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 + max_surge_fixed = optional(number) + instance_redistribution_type = optional(string) + max_surge_percent = optional(number) + max_unavailable_fixed = optional(number) + max_unavailable_percent = optional(number) + min_ready_sec = optional(number) + replacement_method = optional(string) minimal_action = string type = string - most_disruptive_allowed_action = string + most_disruptive_allowed_action = optional(string) })) default = [] } diff --git a/modules/mig/versions.tf b/modules/mig/versions.tf index 20c07d24..fbb10041 100644 --- a/modules/mig/versions.tf +++ b/modules/mig/versions.tf @@ -15,7 +15,7 @@ */ terraform { - required_version = ">=0.13.0" + required_version = ">=1.3.0" required_providers { google = { source = "hashicorp/google" diff --git a/modules/mig_with_percent/README.md b/modules/mig_with_percent/README.md index 5e10aec7..4f03d687 100644 --- a/modules/mig_with_percent/README.md +++ b/modules/mig_with_percent/README.md @@ -46,7 +46,7 @@ The current version is 2.X. The following guides are available to assist with up | stateful\_ips | Statful IPs created on the instances that will be preserved on instance delete. https://cloud.google.com/compute/docs/instance-groups/configuring-stateful-ip-addresses-in-migs |
list(object({
interface_name = string
delete_rule = string
is_external = bool
}))
| `[]` | no | | target\_pools | The target load balancing pools to assign this group to. | `list(string)` | `[]` | no | | target\_size | The target number of running instances for this managed instance group. This value should always be explicitly set unless this resource is attached to an autoscaler, in which case it should never be set. | `number` | `1` | no | -| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
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
}))
| `[]` | no | +| update\_policy | The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy |
list(object({
max_surge_fixed = optional(number)
instance_redistribution_type = optional(string)
max_surge_percent = optional(number)
max_unavailable_fixed = optional(number)
max_unavailable_percent = optional(number)
min_ready_sec = optional(number)
replacement_method = optional(string)
minimal_action = string
type = string
most_disruptive_allowed_action = optional(string)
}))
| `[]` | no | | wait\_for\_instances | Whether to wait for all instances to be created/updated before returning. Note that if this is set to true and the operation does not succeed, Terraform will continue trying until it times out. | `string` | `"false"` | no | ## Outputs diff --git a/modules/mig_with_percent/metadata.yaml b/modules/mig_with_percent/metadata.yaml index e0fab86a..ba7e9b66 100644 --- a/modules/mig_with_percent/metadata.yaml +++ b/modules/mig_with_percent/metadata.yaml @@ -28,7 +28,7 @@ spec: version: 11.1.0 actuationTool: flavor: Terraform - version: ">=0.13.0" + version: ">=1.3.0" description: {} content: examples: @@ -265,16 +265,16 @@ spec: description: The rolling update policy. https://www.terraform.io/docs/providers/google/r/compute_region_instance_group_manager#rolling_update_policy varType: |- 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 + max_surge_fixed = optional(number) + instance_redistribution_type = optional(string) + max_surge_percent = optional(number) + max_unavailable_fixed = optional(number) + max_unavailable_percent = optional(number) + min_ready_sec = optional(number) + replacement_method = optional(string) minimal_action = string type = string - most_disruptive_allowed_action = string + most_disruptive_allowed_action = optional(string) })) defaultValue: [] - name: wait_for_instances diff --git a/modules/mig_with_percent/variables.tf b/modules/mig_with_percent/variables.tf index 759cd9de..40af6859 100644 --- a/modules/mig_with_percent/variables.tf +++ b/modules/mig_with_percent/variables.tf @@ -110,16 +110,16 @@ variable "stateful_ips" { 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 + max_surge_fixed = optional(number) + instance_redistribution_type = optional(string) + max_surge_percent = optional(number) + max_unavailable_fixed = optional(number) + max_unavailable_percent = optional(number) + min_ready_sec = optional(number) + replacement_method = optional(string) minimal_action = string type = string - most_disruptive_allowed_action = string + most_disruptive_allowed_action = optional(string) })) default = [] } diff --git a/modules/mig_with_percent/versions.tf b/modules/mig_with_percent/versions.tf index 0b4c836e..50d2a6f5 100644 --- a/modules/mig_with_percent/versions.tf +++ b/modules/mig_with_percent/versions.tf @@ -15,7 +15,7 @@ */ terraform { - required_version = ">=0.13.0" + required_version = ">=1.3.0" required_providers { google = { source = "hashicorp/google"