Skip to content

Commit 06e47fa

Browse files
authored
fix #88 issues with autogen tmpl for mig (#93)
1 parent 4424b23 commit 06e47fa

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

autogen/main.tf.tmpl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ locals {
2929
}
3030

3131
data "google_compute_zones" "available" {
32-
{% if mig %}
3332
project = var.project_id
3433
region = var.region
35-
{% else %}
36-
region = var.region
37-
{% endif %}
3834
}
3935

4036
resource "google_compute_region_instance_group_manager" "{{ module_name }}" {
@@ -108,9 +104,8 @@ resource "google_compute_region_autoscaler" "autoscaler" {
108104
count = var.autoscaling_enabled ? 1 : 0
109105
name = "${var.hostname}-autoscaler"
110106
project = var.project_id
111-
{% if mig %}
112107
region = var.region
113-
{% endif %}
108+
114109
target = google_compute_region_instance_group_manager.{{ module_name }}.self_link
115110

116111
autoscaling_policy {

modules/mig/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ resource "google_compute_region_autoscaler" "autoscaler" {
8989
name = "${var.hostname}-autoscaler"
9090
project = var.project_id
9191
region = var.region
92+
9293
target = google_compute_region_instance_group_manager.mig.self_link
9394

9495
autoscaling_policy {

modules/mig_with_percent/main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ locals {
2929
}
3030

3131
data "google_compute_zones" "available" {
32-
region = var.region
32+
project = var.project_id
33+
region = var.region
3334
}
3435

3536
resource "google_compute_region_instance_group_manager" "mig_with_percent" {
@@ -96,6 +97,8 @@ resource "google_compute_region_autoscaler" "autoscaler" {
9697
count = var.autoscaling_enabled ? 1 : 0
9798
name = "${var.hostname}-autoscaler"
9899
project = var.project_id
100+
region = var.region
101+
99102
target = google_compute_region_instance_group_manager.mig_with_percent.self_link
100103

101104
autoscaling_policy {

0 commit comments

Comments
 (0)