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

[WIP] Use count instead of for_each because it works better #334

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

julialongtin
Copy link
Contributor

No description provided.

@lucendio
Copy link
Contributor

lucendio commented Sep 3, 2020

Can you elaborate on what exactly "works better"?

In my experience, the problem with count is always that the index is being used as instance identifier and if you want to remove a single resource instance, all subsequent instances might be recreated, which might not be desired - especially with machines.

But in case this is just not applicable here or this pitfall is known already, please feel free to ignore me. I'm probably just lacking of some context.

@julialongtin
Copy link
Contributor Author

sure, that's an issue, but in this case, the use of for_each is blocking terraform from knowing how many of these instances will be created, and causing terraform not to be able to plan. so, we can either have "apply some things, with files moved around, move files back, and apply other things" with manipulated instance identifiers, OR we can have automatic identifiers, and none of the multi-staged application. this gives us the latter.

@julialongtin julialongtin merged commit de328cf into develop Sep 10, 2020
@julialongtin julialongtin deleted the arian-was-wrong branch September 10, 2020 11:52
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.

4 participants