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

Adding and Removing Services Causing Re-creation of all the resource #43

Open
Sanyambansal76 opened this issue Oct 3, 2019 · 7 comments

Comments

@Sanyambansal76
Copy link

Hi,

Thanks for building this module, I am facing a similar issue described in the following link hashicorp/terraform#17179

I think we should modify the existing code to use for_each

@jlsan92
Copy link
Contributor

jlsan92 commented Oct 4, 2019

Hello @Sanyambansal76, thanks for reaching out.

Please, could you provide the version you're using and steps to reproduce?

What do you mean by "Re-creation of all the resource"?

@Overbryd
Copy link

Overbryd commented Oct 24, 2019

I experience similar inconsistencies and an exhaustive re-creation of resources if I change anything inside a service. For me, this leads to unnecessary downtimes of the application when I upgrade the fargate declaration.

Maybe too many resources depend on something that is defined in a service, and thus it triggers recreation of those resources.

@Overbryd
Copy link

Overbryd commented Oct 24, 2019

For example: Adding an acm_certificate_arn to a service, should not cause the following changeset:

Plan: 22 to add, 1 to change, 21 to destroy.

------------------------------------------------------------------------

It event recreates the ECR repository, leading to the CodePipeline to fail, leading to new pushes being ignored, leading to a complete standstill.

@Sanyambansal76
Copy link
Author

@jlsan92 Sorry I was on vacation for last few days, I think it is happening because the resource and their state are uniquely identified by the index, not by their name, so if we change something in the order, hash calculated again and resources mismatched with hash index values and lead to the re-creation of resources. Following are the use-cases when hash recalculated for index

*We can add new rules only at the end of the hash.
*We can remove rules only at the end of the hash.
*We can modify the rules, as long as their position in the hash doesn't change.
*But we can never remove any other rule or change their position in the hash.

Terraform Version - 0.12.12

@Sanyambansal76
Copy link
Author

I had re-written the whole module for my use-case if you want i can send a PR request next week.

@Sanyambansal76
Copy link
Author

@jlsan92 any update?

@sloops77
Copy link

@Sanyambansal76 could you share this code in your own fork online so we can all benefit?

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

No branches or pull requests

4 participants