Skip to content

Commit 0177b6b

Browse files
authored
Merge pull request #37 from SmallLab/master
issue #28 - RegionInstanceGroupManager is forced to be re-created - fix.
2 parents 2e544f2 + d68f6b4 commit 0177b6b

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [1.1.1] - 2019-10-25
11+
### Fixed
12+
13+
- Fix bug with `distribution_policy_zones` forcing permadiff. [#37]
14+
1015
## [1.1.0] - 2019-10-23
1116

1217
### Added
@@ -49,4 +54,5 @@ project adheres to [Semantic Versioning](http://semver.org/).
4954
[#18]: https://github.com/terraform-google-modules/terraform-google-vm/pull/18
5055
[#19]: https://github.com/terraform-google-modules/terraform-google-vm/pull/19
5156
[#26]: https://github.com/terraform-google-modules/terraform-google-vm/pull/26
57+
[#37]: https://github.com/terraform-google-modules/terraform-google-vm/pull/37
5258
[#38]: https://github.com/terraform-google-modules/terraform-google-vm/pull/38

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ The following APIs must be enabled on your project:
2525

2626
See also the [project_services](modules/project_services) module (optional).
2727

28+
## Notes
29+
30+
`distribution_policy_zones` cannot be changed during use. If you have changed them yourself or
31+
used to have a default value, then you'll have to force recreate a MIG group yourself.
32+
2833
## Test Configuration
2934

3035
1. Create a `terraform.tfvars` file, using `terraform.tfvars.example` as an example

modules/mig/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ resource "google_compute_region_instance_group_manager" "mig" {
5656
health_check = length(local.healthchecks) > 0 ? local.healthchecks[0] : ""
5757
initial_delay_sec = length(local.healthchecks) > 0 ? var.hc_initial_delay_sec : 0
5858
}
59+
5960
distribution_policy_zones = local.distribution_policy_zones
6061
dynamic "update_policy" {
6162
for_each = var.update_policy
@@ -72,6 +73,7 @@ resource "google_compute_region_instance_group_manager" "mig" {
7273

7374
lifecycle {
7475
create_before_destroy = "true"
76+
ignore_changes = ["distribution_policy_zones"]
7577
}
7678
}
7779

@@ -141,4 +143,3 @@ resource "google_compute_health_check" "tcp_healthcheck" {
141143
port = var.hc_port
142144
}
143145
}
144-

modules/mig_with_percent/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ resource "google_compute_region_instance_group_manager" "mig_with_percent" {
8282

8383
lifecycle {
8484
create_before_destroy = "true"
85+
ignore_changes = ["distribution_policy_zones"]
8586
}
8687
}
8788

0 commit comments

Comments
 (0)