Closed jmcgeheeiv closed 4 years ago
I added a destroy procedure. Using this module this way works very smoothly. Very nice architecture!
I was just thinking the other day of doing something like this, I didn't know such functionality was already in place just not documented!
However I'm wondering since it is so far undocumented can we make the following changes before this goes "public":
I would be happy to submit some PR for same changes in other repos if that helps, I don't remember seeing any of them advertise this approach either.
This is an interesting approach!
pretty sure you will have to set force_destroy to true before doing the final apply since the bucket is versioned
Yes, I encountered that last time I did terraform destroy
. I'm also reconsidering whether the backend file should be added to .gitignore
, or whether it should be committed to Git. I want to try the workflow a few more times, but right now I'm away from this part of the project now. Still, the basic workflow is quite good. It is CloudPosse that deserves credit for that, @osterman.
Sorry we haven’t been able to review this yet. We’ve been slammed with new projects.
Has anyone else had a chance to test this out?
No rush, @osterman. In fact, I will change this to WIP because I still want to check into the issues I mentioned in my last comment.
@jmcgeheeiv even though the file is auto-generated I think it should be committed: if there is a change in the tf state module, or you make a change in input values, that you didn't realize would affect it, you will be able to see the change with git diff. Whereas without having committed it, you will only see what the plan tells you has changed, there will be no source to check for diff to help understand cause of change.
Also is there any disadvantage? If a timestamp or other attribute in the generated file changed at every apply, that would be a good reason to gitignore it, but that's not the case.
@schollii, in my most recent pass through the workflow I have made these changes:
./backend.tf
. terraform.tf
is not descriptive../backend.tf
to gitShall I implement these changes in the documentation?
I gather this will work on v0.16.0? Pretty sure I had issues with 0.17.0 (#47). It seems like it's only the docs that are changing. I believe the workflow is this:
However I cannot verify that right now, but if you don't do that, then during terraform destroy you will get an error that the bucket has contents. After I deleted manually from AWS console a couple weeks ago, the destroy worked.
@jmcgeheeiv I have verified the workflow and documented at https://github.com/cloudposse/terraform-aws-tfstate-backend/issues/44#issuecomment-640954116 since PR's are harder to find. HTH.
@jmcgeheeiv Definitely like the idea of getting this merged. I personally didn't know about this functionality and it sounds much preferred! Weighing in on a couple things:
backend.tf
> terraform.tf
👍 backend.tf
to git -- I only see negatives in not doing this. I think this is the right call. Happy to get this PR approved, merged, and cut for you as soon as you and @schollii suss out the final changes you want to make to the README. Thanks gents!
Modified to match @schollii's procedure in #44 without question--because he seems like such a trustworthy chap.
@schollii, @Gowiem, please scrutinize.
Today I had an opportunity to destroy a deployment, and I found an error in my destroy procedure (wrong value for force_destroy
).
I also added @schollii as a contributor. I hope you do not mind. If this bothers you, I can remove you from my fork and nobody will be the wiser.
/rebuild-readme
@jmcgeheeiv Sorry to do it to ya, but it looks like there are some merge conflicts. Mind fixing and we'll get this merged?
@aknysh markdown doesn't require sequence of numbers just first one must be '1'. See https://www.markdownguide.org/basic-syntax/#ordered-lists.
However the readme is understandable without rendering if we use sequence of numbers. For small lists it's manageable, so I'm in favour of fixing.
IMO 1s are preferable, since you dont need to reorder them if you add an item in the middle of the list
IMO 1s are preferable, since you dont need to reorder them if you add an item in the middle of the list
ah yes, the user will see it as an unordered list, it's just in the code itself we have 1
.
They will see it as an ordered list
They will see it as an ordered list
@aknysh Did you mean to close this? I would think we would still want to get this merged. Mind if I reopen?
@aknysh Did you mean to close this? I would think we would still want to get this merged. Mind if I reopen?
oh sorry, clicked the wrong button, reopening
/test all
what
terraform.tf
to the usage instructionswhy
terraform.tf
, which is actually quite brilliant functionalityreferences