Skip to content

Commit

Permalink
chore: Simplify distribution policy zones in MIG modules (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpdownes authored Jul 18, 2023
1 parent bd3526c commit 31a9d8e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions autogen/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ locals {
google_compute_health_check.http.*.self_link,
google_compute_health_check.tcp.*.self_link,
)
distribution_policy_zones_base = {
default = data.google_compute_zones.available.names
user = var.distribution_policy_zones
}
distribution_policy_zones = local.distribution_policy_zones_base[length(var.distribution_policy_zones) == 0 ? "default" : "user"]
distribution_policy_zones = coalescelist(var.distribution_policy_zones, data.google_compute_zones.available.names)
autoscaling_scale_in_enabled = var.autoscaling_scale_in_control.fixed_replicas != null || var.autoscaling_scale_in_control.percent_replicas != null
}

Expand Down
6 changes: 1 addition & 5 deletions modules/mig/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ locals {
google_compute_health_check.http.*.self_link,
google_compute_health_check.tcp.*.self_link,
)
distribution_policy_zones_base = {
default = data.google_compute_zones.available.names
user = var.distribution_policy_zones
}
distribution_policy_zones = local.distribution_policy_zones_base[length(var.distribution_policy_zones) == 0 ? "default" : "user"]
distribution_policy_zones = coalescelist(var.distribution_policy_zones, data.google_compute_zones.available.names)
autoscaling_scale_in_enabled = var.autoscaling_scale_in_control.fixed_replicas != null || var.autoscaling_scale_in_control.percent_replicas != null
}

Expand Down
6 changes: 1 addition & 5 deletions modules/mig_with_percent/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ locals {
google_compute_health_check.http.*.self_link,
google_compute_health_check.tcp.*.self_link,
)
distribution_policy_zones_base = {
default = data.google_compute_zones.available.names
user = var.distribution_policy_zones
}
distribution_policy_zones = local.distribution_policy_zones_base[length(var.distribution_policy_zones) == 0 ? "default" : "user"]
distribution_policy_zones = coalescelist(var.distribution_policy_zones, data.google_compute_zones.available.names)
autoscaling_scale_in_enabled = var.autoscaling_scale_in_control.fixed_replicas != null || var.autoscaling_scale_in_control.percent_replicas != null
}

Expand Down

0 comments on commit 31a9d8e

Please sign in to comment.