Skip to content
New issue

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

GCE Autoscaler: terraform only lets you select one policy while gce allows multiple, metric target types don't match gce #38

Closed
hashibot opened this issue Jun 13, 2017 · 2 comments · Fixed by #966
Assignees
Labels

Comments

@hashibot
Copy link

This issue was originally opened by @nwwebb as hashicorp/terraform#7614. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version:
v0.6.16

Affected Resource:
google_compute_autoscaler

Expected Behavior:

  • GCE allows multiple policies to be applied to an autoscaler. The user can specify cpu utilization, load balancing utilization and multiple metrics utilizations if they choose.
  • The metric utilization target types in GCE are gauge, delta/min, delta/sec.

Actual Behavior:

  • Terraform doesn't support multiple policies for an autoscaler in a config file.
  • When Terraform attempts to update an autoscaler with a new policy (ex: changing from cpu utilization to load balancer utilization) it creates an autoscaler with both policies.
  • The metric utilization target types for a Terraform config file are gauge, delta, cumulative

Steps to Reproduce:

The following resource will cause Terraform to complain because multiple policies are specified, although gce lets the user select multiple policies.

resource "google_compute_autoscaler" "foobar" {
  name   = "foobar"
  zone   = "us-central1-f"
  target = "${google_compute_instance_group_manager.foobar.self_link}"

  autoscaling_policy = {
    max_replicas    = 5
    min_replicas    = 1
    cooldown_period = 60

    cpu_utilization {
      target = 0.5
    }
    load_balancer_utilization {
      target = 0.5
  }
}

Also, if you were to apply this autoscaler:

resource "google_compute_autoscaler" "foobar" {
  name   = "foobar"
  zone   = "us-central1-f"
  target = "${google_compute_instance_group_manager.foobar.self_link}"

  autoscaling_policy = {
    max_replicas    = 5
    min_replicas    = 1
    cooldown_period = 60

    cpu_utilization {
      target = 0.5
    }
  }
}

Followed by this:

resource "google_compute_autoscaler" "foobar" {
  name   = "foobar"
  zone   = "us-central1-f"
  target = "${google_compute_instance_group_manager.foobar.self_link}"

  autoscaling_policy = {
    max_replicas    = 5
    min_replicas    = 1
    cooldown_period = 60

    load_balancing_utilization {
      target = 0.5
    }
  }
}

Terraform will create an autoscaler with load balancing and cpu utilization set rather than remove the cpu utilization.

@lwander

@hashibot hashibot added the bug label Jun 13, 2017
@nat-henderson nat-henderson self-assigned this Jan 16, 2018
@nat-henderson
Copy link
Contributor

Agreed! We should try to match the API here. I'm on it. :)

luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
@ghost
Copy link

ghost commented Mar 30, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants