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

in google_compute_instance_group_manager if target_size is set to 0 value get ignored #13

Closed
dgolja opened this issue Jun 12, 2017 · 1 comment · Fixed by #65
Closed
Labels

Comments

@dgolja
Copy link

dgolja commented Jun 12, 2017

Hi there,

In google_compute_instance_group_manager if you set target_size to 0 the value get ignored and the default value of 1 get applied at the first apply. Similar issue when you try to change the value from a non zero value to zero. Terraform will detect the change however when applying the plan the value will not got changed to 0.

Terraform Version

  • terraform v0.96
  • terraform v0.97
  • terraform v0.98

Affected Resource(s)

Please list the resources as a list, for example:

  • google_compute_instance_group_manager

Terraform Configuration Files

resource "google_compute_instance_template" "template" {
  name_prefix = "template-server"

  region = "${var.region}"

  lifecycle {
    create_before_destroy = true
  }

  network_interface {
    network = "default"
  }

  machine_type         = "f1-micro"
  can_ip_forward       = false

  scheduling {
    automatic_restart   = true
    on_host_maintenance = "TERMINATE"
  }

  // Create a new boot disk from an image
  disk {
    source_image = "projects/ubuntu-os-cloud/global/images/ubuntu-1604-xenial-v20170516"
    disk_type    = "pd-ssd"
    auto_delete  = true
    boot         = true
  }


  service_account {
    scopes = [ ]
  }

}

resource "google_compute_instance_group_manager" "group_manager" {
  name        = "instance-group-tf-bug"

  base_instance_name = "servers"
  instance_template  = "${google_compute_instance_template.template.self_link}"
  update_strategy    = "NONE"

  zone        = "us-central1-a"
  target_size = 0
}

Debug Output

google_compute_instance_group_manager.group_manager: Creating...
  base_instance_name: "" => "servers"
  fingerprint:        "" => "<computed>"
  instance_group:     "" => "<computed>"
  instance_template:  "" => "https://www.googleapis.com/compute/v1/projects/cloud-staging-168820/global/instanceTemplates/template-server0028f8764b2b18e1b29f3ea74a"
  name:               "" => "instance-group-tf-bug"
  project:            "" => "<computed>"
  self_link:          "" => "<computed>"
  target_size:        "" => "0"
  update_strategy:    "" => "NONE"
  zone:               "" => "us-central1-a"

Expected Behavior

Inttance group number of instances should be 0 and no instances should be created.

Actual Behavior

Instance group number of instances is 1

Steps to Reproduce

  1. terraform apply
@ghost
Copy link

ghost commented Mar 31, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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