diff --git a/autogen/main.tf.tmpl b/autogen/main.tf.tmpl index 787fccbf..68cb5002 100644 --- a/autogen/main.tf.tmpl +++ b/autogen/main.tf.tmpl @@ -174,6 +174,7 @@ resource "google_compute_region_autoscaler" "autoscaler" { name = lookup(metric.value, "name", null) target = lookup(metric.value, "target", null) type = lookup(metric.value, "type", null) + filter = lookup(metric.value, "filter", null) } } dynamic "load_balancing_utilization" { diff --git a/modules/mig/README.md b/modules/mig/README.md index 9d54b711..5b53fe57 100644 --- a/modules/mig/README.md +++ b/modules/mig/README.md @@ -22,7 +22,7 @@ The current version is 2.X. The following guides are available to assist with up | autoscaling\_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#cpu_utilization |
list(object({
target = number
predictive_method = string
})) | `[]` | no |
| autoscaling\_enabled | Creates an autoscaler for the managed instance group | `string` | `"false"` | no |
| autoscaling\_lb | Autoscaling, load balancing utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#load_balancing_utilization | `list(map(number))` | `[]` | no |
-| autoscaling\_metric | Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric | list(object({
name = string
target = number
type = string
})) | `[]` | no |
+| autoscaling\_metric | Autoscaling, metric policy block as single element array. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_region_autoscaler#metric-1 | list(object({
name = string
target = number
type = string
filter = optional(string)
})) | `[]` | no |
| autoscaling\_mode | Operating mode of the autoscaling policy. If omitted, the default value is ON. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_autoscaler#mode | `string` | `null` | no |
| autoscaling\_scale\_in\_control | Autoscaling, scale-in control block. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#scale_in_control | object({
fixed_replicas = number
percent_replicas = number
time_window_sec = number
}) | {
"fixed_replicas": null,
"percent_replicas": null,
"time_window_sec": null
} | no |
| cooldown\_period | The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. | `number` | `60` | no |
diff --git a/modules/mig/main.tf b/modules/mig/main.tf
index 2b3e2696..c0bae75f 100644
--- a/modules/mig/main.tf
+++ b/modules/mig/main.tf
@@ -158,6 +158,7 @@ resource "google_compute_region_autoscaler" "autoscaler" {
name = lookup(metric.value, "name", null)
target = lookup(metric.value, "target", null)
type = lookup(metric.value, "type", null)
+ filter = lookup(metric.value, "filter", null)
}
}
dynamic "load_balancing_utilization" {
diff --git a/modules/mig/metadata.yaml b/modules/mig/metadata.yaml
index 675e571a..3c36ab75 100644
--- a/modules/mig/metadata.yaml
+++ b/modules/mig/metadata.yaml
@@ -224,12 +224,13 @@ spec:
}))
defaultValue: []
- name: autoscaling_metric
- description: Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric
+ description: Autoscaling, metric policy block as single element array. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_region_autoscaler#metric-1
varType: |-
list(object({
name = string
target = number
type = string
+ filter = optional(string)
}))
defaultValue: []
- name: autoscaling_lb
diff --git a/modules/mig/variables.tf b/modules/mig/variables.tf
index 3ce60742..b79bb8b9 100644
--- a/modules/mig/variables.tf
+++ b/modules/mig/variables.tf
@@ -206,11 +206,12 @@ variable "autoscaling_cpu" {
}
variable "autoscaling_metric" {
- description = "Autoscaling, metric policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler#metric"
+ description = "Autoscaling, metric policy block as single element array. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_region_autoscaler#metric-1"
type = list(object({
name = string
target = number
type = string
+ filter = optional(string)
}))
default = []
}