Skip to content

Commit

Permalink
Merge pull request #37 from SmallLab/master
Browse files Browse the repository at this point in the history
issue #28 - RegionInstanceGroupManager is forced to be re-created - fix.
  • Loading branch information
morgante authored Oct 25, 2019
2 parents 2e544f2 + d68f6b4 commit 0177b6b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [1.1.1] - 2019-10-25
### Fixed

- Fix bug with `distribution_policy_zones` forcing permadiff. [#37]

## [1.1.0] - 2019-10-23

### Added
Expand Down Expand Up @@ -49,4 +54,5 @@ project adheres to [Semantic Versioning](http://semver.org/).
[#18]: https://github.com/terraform-google-modules/terraform-google-vm/pull/18
[#19]: https://github.com/terraform-google-modules/terraform-google-vm/pull/19
[#26]: https://github.com/terraform-google-modules/terraform-google-vm/pull/26
[#37]: https://github.com/terraform-google-modules/terraform-google-vm/pull/37
[#38]: https://github.com/terraform-google-modules/terraform-google-vm/pull/38
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ The following APIs must be enabled on your project:

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

## Notes

`distribution_policy_zones` cannot be changed during use. If you have changed them yourself or
used to have a default value, then you'll have to force recreate a MIG group yourself.

## Test Configuration

1. Create a `terraform.tfvars` file, using `terraform.tfvars.example` as an example
Expand Down
3 changes: 2 additions & 1 deletion modules/mig/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ resource "google_compute_region_instance_group_manager" "mig" {
health_check = length(local.healthchecks) > 0 ? local.healthchecks[0] : ""
initial_delay_sec = length(local.healthchecks) > 0 ? var.hc_initial_delay_sec : 0
}

distribution_policy_zones = local.distribution_policy_zones
dynamic "update_policy" {
for_each = var.update_policy
Expand All @@ -72,6 +73,7 @@ resource "google_compute_region_instance_group_manager" "mig" {

lifecycle {
create_before_destroy = "true"
ignore_changes = ["distribution_policy_zones"]
}
}

Expand Down Expand Up @@ -141,4 +143,3 @@ resource "google_compute_health_check" "tcp_healthcheck" {
port = var.hc_port
}
}

1 change: 1 addition & 0 deletions modules/mig_with_percent/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ resource "google_compute_region_instance_group_manager" "mig_with_percent" {

lifecycle {
create_before_destroy = "true"
ignore_changes = ["distribution_policy_zones"]
}
}

Expand Down

0 comments on commit 0177b6b

Please sign in to comment.