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

Autoscaling signal empty condition #322

Closed
Minakhalil91 opened this issue Jun 29, 2023 · 1 comment
Closed

Autoscaling signal empty condition #322

Minakhalil91 opened this issue Jun 29, 2023 · 1 comment
Labels
bug Something isn't working Stale

Comments

@Minakhalil91
Copy link

TL;DR

When using the following autoscaling signal, an empty condition is created, which causes a UI error " This item contains one or more errors "

 metric {
  name   = "compute.googleapis.com/instance/cpu/utilization"
  target = 0.75
  type   = "GAUGE"

Expected behavior

Expected Metrics signal to look like this:

B9XJaqZ29LSHQdW

Observed behavior

Instead, there is an empty condition that is causing a UI issue.

image

Terraform Configuration

resource "google_compute_autoscaler" "default" {
  provider = google-beta

  name   = "my-autoscaler"
  zone   = "us-central1-f"
  target = google_compute_instance_group_manager.default.id

  autoscaling_policy {
    max_replicas    = 5
    min_replicas    = 1
    cooldown_period = 60

    metric {
      name   = "compute.googleapis.com/instance/cpu/utilization"
      target = 0.75
      type   = "GAUGE"
    }
  }
}

resource "google_compute_instance_template" "default" {
  provider = google-beta

  name           = "my-instance-template"
  machine_type   = "e2-medium"
  can_ip_forward = false

  tags = ["foo", "bar"]

  disk {
    source_image = data.google_compute_image.debian_9.id
  }

  network_interface {
    network = "default"
  }

  metadata = {
    foo = "bar"
  }

  service_account {
    scopes = ["userinfo-email", "compute-ro", "storage-ro"]
  }
}

resource "google_compute_target_pool" "default" {
  provider = google-beta

  name = "my-target-pool"
}

resource "google_compute_instance_group_manager" "default" {
  provider = google-beta

  name = "my-igm"
  zone = "us-central1-f"

  version {
    instance_template = google_compute_instance_template.default.id
    name              = "primary"
  }

  target_pools       = [google_compute_target_pool.default.id]
  base_instance_name = "autoscaler-sample"
}

data "google_compute_image" "debian_9" {
  provider = google-beta

  family  = "debian-11"
  project = "debian-cloud"
}

provider "google-beta" {
  region = "us-central1"
  zone   = "us-central1-a"

}

Terraform Version

Terraform v1.5.1

Additional information

Terraform might be accounting for the aggregator field and adding the extra = that is causing the issue. If i click edit from the UI and turn on and off the aggregator the extra condition is removed and the issue is fixed.

image

@Minakhalil91 Minakhalil91 added the bug Something isn't working label Jun 29, 2023
@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Aug 28, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

1 participant