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

issue #28 - RegionInstanceGroupManager is forced to be re-created - fix. #37

Merged
merged 6 commits into from
Oct 25, 2019

Conversation

pksmall
Copy link
Contributor

@pksmall pksmall commented Oct 21, 2019

Fixes #28

Highlight:

~ distribution_policy_zones = [
          - "europe-west3-a",
          - "europe-west3-b",
          - "europe-west3-c",
        ] -> (known after apply) # forces replacement

ignore using lifecycle

@morgante
Copy link
Contributor

@pksmall I'm not sure this is a sufficient fix, as it would prevent people from updating the desired zones of a MIG after creating it.

@pksmall
Copy link
Contributor Author

pksmall commented Oct 22, 2019

@morgante Agree, but this will have to change:

  lifecycle {
    create_before_destroy = "true"
  }

to false

I added to a test project distribution_policy_zones by groups and got same error.

@morgante
Copy link
Contributor

I'm still unclear what is happening here though.

Without this, is Terraform claiming that the distribution zones have changed with every apply (even when they are untouched)?

@pksmall
Copy link
Contributor Author

pksmall commented Oct 23, 2019

@morgante Exactly,

data "google_compute_zones" "available" {
  project = var.project_id
}

this definition is not constant for Terraform. Every apply Terraform overwrites a new.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks. This does seem like the only workable fix unfortunately.

Could you add a note to the README and CHANGELOG that you will have to force recreation yourself if you want to change distribution zones?

@pksmall
Copy link
Contributor Author

pksmall commented Oct 25, 2019

@morgante sure.

If you accept this fix, it would be nice to remove the unnecessary code from the module.

@pksmall pksmall requested a review from morgante October 25, 2019 13:43
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
pksmall and others added 2 commits October 25, 2019 11:19
Co-Authored-By: Morgante Pell <[email protected]>
Co-Authored-By: Morgante Pell <[email protected]>
@pksmall pksmall requested a review from morgante October 25, 2019 15:20
@morgante morgante merged commit 0177b6b into terraform-google-modules:master Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MIG module: RegionInstanceGroupManager is forced to be re-created on every provision
2 participants