Closed MikeMoore63 closed 3 years ago
@MikeMoore63 there is a test (below) that works fine. Can you compare the differences?
JUst created using gcloud and all worked fine but log looked similar so puzzled as to
@MikeMoore63 there is a test (below) that works fine. Can you compare the differences?
Ok so played around with this it only errors when min_required_replicas = 0.
Using gcloud/console I can set to 0.
A work around for this is set min_replicas in outer resource to 0 and just scale up which works. This as docs state after duration is passed reverts to default behavior.
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error π€ π , please reach out to my human friends π hashibot-feedback@hashicorp.com. Thanks!
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.12.24
google_compute_region_autoscaler - beta
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Expected to create auto scaller with schedule connected to mig
Actual Behavior
Error: Error creating RegionAutoscaler: googleapi: Error 400: Required field 'resource.autoscalingPolicy.scalingSchedules.key' not specified, required
In the api call you can see terraform generted an api call like this
'''
2021-04-25T13:47:50.603+0100 [INFO] plugin.terraform-provider-google-beta_v3.55.0_x5: 2021/04/25 13:47:50 [DEBUG] Waiting for state to become: [success]: timestamp=2021-04-25T13:47:50.603+0100 2021-04-25T13:47:50.604+0100 [INFO] plugin.terraform-provider-google-beta_v3.55.0_x5: 2021/04/25 13:47:50 [DEBUG] Retry Transport: starting RoundTrip retry loop: timestamp=2021-04-25T13:47:50.604+0100 2021-04-25T13:47:50.604+0100 [INFO] plugin.terraform-provider-google-beta_v3.55.0_x5: 2021/04/25 13:47:50 [DEBUG] Retry Transport: request attempt 0: timestamp=2021-04-25T13:47:50.604+0100 2021-04-25T13:47:50.604+0100 [INFO] plugin.terraform-provider-google-beta_v3.55.0_x5: 2021/04/25 13:47:50 [DEBUG] Google API Request Details: ---[ REQUEST ]--------------------------------------- POST /compute/beta/projects/xxxxxx/regions/europe-west1/autoscalers?alt=json HTTP/1.1 Host: compute.googleapis.com User-Agent: Terraform/0.12.26 (+https://www.terraform.io) Terraform-Plugin-SDK/2.4.2 terraform-provider-google-beta/dev Content-Length: 666 Content-Type: application/json Accept-Encoding: gzip
{ "autoscalingPolicy": { "coolDownPeriodSec": 60, "cpuUtilization": { "utilizationTarget": 1 }, "maxNumReplicas": 1, "minNumReplicas": 1, "mode": "ON", "scalingSchedules": { "weekday": { "description": "scale build bridge down at weekdays", "durationSec": 64800, "minRequiredReplicas": 1, "schedule": "0 3 MON,TUE,WED,THU,FRI", "timeZone": "UTC" }, "weekend": { "description": "scale build bridge down at weekends", "durationSec": 129600, "schedule": "0 3 SAT", "timeZone": "UTC" } } }, "name": "repobridge-scaler", "region": "projects/xxxxxx/global/regions/europe-west1", "target": "projects/xxxxxx/regions/europe-west1/instanceGroupManagers/gce-europe-west1-b-d-repobridge" }
-----------------------------------------------------: timestamp=2021-04-25T13:47:50.604+0100 2021-04-25T13:47:53.359+0100 [INFO] plugin.terraform-provider-google-beta_v3.55.0_x5: 2021/04/25 13:47:53 [DEBUG] Google API Response Details: ---[ RESPONSE ]-------------------------------------- HTTP/1.1 400 Bad Request Connection: close Transfer-Encoding: chunked Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43" Cache-Control: private Content-Type: application/json; charset=UTF-8 Date: Sun, 25 Apr 2021 12:47:53 GMT Server: ESF Vary: Origin Vary: X-Origin Vary: Referer X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-Xss-Protection: 0
14b { "error": { "code": 400, "message": "Required field 'resource.autoscalingPolicy.scalingSchedules.key' not specified", "errors": [ { "message": "Required field 'resource.autoscalingPolicy.scalingSchedules.key' not specified", "domain": "global", "reason": "required" } ] } } '''
Steps to Reproduce
Create any scaling auto mig with a scaling_schedule
terraform apply
Important Factoids
References
https://cloud.google.com/compute/docs/reference/rest/beta/regionAutoscalers/get
0000