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

Fix redeploy google_compute_region_instance_group_manager on each apply #34

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/instance_template/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,6 @@ variable "service_account" {
email = string
scopes = set(string)
})
default = null
description = "Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#service_account."
}
10 changes: 7 additions & 3 deletions modules/mig/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ resource "google_compute_region_instance_group_manager" "mig" {
target_pools = var.target_pools
target_size = var.autoscaling_enabled ? var.min_replicas : var.target_size

auto_healing_policies {
health_check = length(local.healthchecks) > 0 ? local.healthchecks[0] : ""
initial_delay_sec = length(local.healthchecks) > 0 ? var.hc_initial_delay_sec : 0
dynamic "auto_healing_policies" {
for_each = local.healthchecks
iterator = healthcheck
content {
health_check = healthcheck.value
initial_delay_sec = var.hc_initial_delay_sec
}
}
distribution_policy_zones = local.distribution_policy_zones
dynamic "update_policy" {
Expand Down
12 changes: 8 additions & 4 deletions modules/mig_with_percent/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ resource "google_compute_region_instance_group_manager" "mig_with_percent" {
target_pools = var.target_pools
target_size = var.autoscaling_enabled ? var.min_replicas : var.target_size

auto_healing_policies {
health_check = length(local.healthchecks) > 0 ? local.healthchecks[0] : ""
initial_delay_sec = length(local.healthchecks) > 0 ? var.hc_initial_delay_sec : 0
dynamic "auto_healing_policies" {
for_each = local.healthchecks
iterator = healthcheck
content {
health_check = healthcheck.value
initial_delay_sec = var.hc_initial_delay_sec
}
}

distribution_policy_zones = local.distribution_policy_zones
dynamic "update_policy" {
for_each = var.update_policy
Expand Down