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

[Feature Suggestion] Lock on terraform plan #50

Closed
mechastorm opened this issue Nov 14, 2016 · 1 comment
Closed

[Feature Suggestion] Lock on terraform plan #50

mechastorm opened this issue Nov 14, 2016 · 1 comment

Comments

@mechastorm
Copy link
Contributor

Great tool here! Helps solves my team's issue with state conflicts while we figure out our long term solution.

I was wondering if it makes sense to optionally lock at the "terraform plan" stage instead of apply? From what I understood in terragrunt, the locking is only at the "apply" stage (which is great).

The terraform workflow I've been following is

  1. terraform plan and output a plan file
  2. Get a peer review on the plan and approve it if needed
  3. terraform apply against the plan file

So in general, we always ran "terraform apply" against a plan file.

At a previous organisation, we had a bespoke solution where we locked the state file when we begin "plan" stage. That meant that

  • no one can change (apply) the infrastructure until that plan has been applied or the user released the lock for that plan.
  • other users can still run plan but when they apply their changes on a locked state, they will be prompetd to wait for that other plan to be run and re-run their plan against the new changes
  • the user's plan is going to be applied against a state that did not change during the peer review period. There is no chance between the "plan" and "apply" stage that the infrastructure got changed by someone else.

Any thoughts?

@brikis98
Copy link
Member

We've had a few requests for long-term locks. Probably the best way to handle it is with a terragrunt lock command. It should be pretty easy to add. Are you interested in submitting a PR?

In the meantime, I'm going to close this issue in favor of #19, since it's more or less a dupe, and I'd like to consolidate the conversation in one place.

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

2 participants