Skip to content

Commit

Permalink
Update variable type for autoscaling_cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirukumaran Vaseeharan authored and vasyharan committed Oct 17, 2022
1 parent 64b0d14 commit 66e45b4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
5 changes: 4 additions & 1 deletion autogen/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ variable "autoscaling_mode" {

variable "autoscaling_cpu" {
description = "Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization"
type = list(map(number))
type = list(object({
target = number
predictive_method = string
}))
default = []
}

Expand Down
3 changes: 2 additions & 1 deletion examples/mig/healthcheck/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ module "mig" {

autoscaling_cpu = [
{
target = 0.4
target = 0.4
predictive_method = null # use default of NONE
},
]

Expand Down
2 changes: 1 addition & 1 deletion modules/mig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The current version is 2.X. The following guides are available to assist with up
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| autoscaler\_name | Autoscaler name. When variable is empty, name will be derived from var.hostname. | `string` | `""` | no |
| autoscaling\_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization | `list(map(number))` | `[]` | no |
| autoscaling\_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization | <pre>list(object({<br> target = number<br> predictive_method = string<br> }))</pre> | `[]` | 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.html#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.html#metric | <pre>list(object({<br> name = string<br> target = number<br> type = string<br> }))</pre> | `[]` | no |
Expand Down
7 changes: 5 additions & 2 deletions modules/mig/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ variable "autoscaling_mode" {

variable "autoscaling_cpu" {
description = "Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization"
type = list(map(number))
default = []
type = list(object({
target = number
predictive_method = string
}))
default = []
}

variable "autoscaling_metric" {
Expand Down
2 changes: 1 addition & 1 deletion modules/mig_with_percent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The current version is 2.X. The following guides are available to assist with up
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| autoscaler\_name | Autoscaler name. When variable is empty, name will be derived from var.hostname. | `string` | `""` | no |
| autoscaling\_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization | `list(map(number))` | `[]` | no |
| autoscaling\_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization | <pre>list(object({<br> target = number<br> predictive_method = string<br> }))</pre> | `[]` | 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.html#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.html#metric | <pre>list(object({<br> name = string<br> target = number<br> type = string<br> }))</pre> | `[]` | no |
Expand Down
7 changes: 5 additions & 2 deletions modules/mig_with_percent/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ variable "autoscaling_mode" {

variable "autoscaling_cpu" {
description = "Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization"
type = list(map(number))
default = []
type = list(object({
target = number
predictive_method = string
}))
default = []
}

variable "autoscaling_metric" {
Expand Down

0 comments on commit 66e45b4

Please sign in to comment.