-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add ability to force unlock TF state and fix digest value of lock file in DynamoDB #235
Merged
Commits on Aug 30, 2023
-
Add ability to force unlock TF state
Sometimes, if a failure occurs or you've Ctrl+C'ed out of the middle of an apply, the Terraform state may be left in a locked state. When this happens, you must run 'terraform force-unlock' with the lock ID to unlock it. This change detects when an apply results in a lock error, and prompts the user to rerun the command with the --force-unlock flag. It does this by capturing the stderr stream of the 'terraform apply' command to inspect the message if an error occurs. An added bonus is that since we are using Popen to execute the command, we can handle things more gracefully if a user Ctrl+Cs out of the apply and allow Terraform to release the lock, reducing the amount of ways we can get into this failure state. In order to support the --force-unlock flag, there will be a change to the civiform-deploy repo as well.
Configuration menu - View commit details
-
Copy full SHA for bac0f13 - Browse repository at this point
Copy the full SHA bac0f13View commit details -
Add ability to fix digest value of lock file in DynamoDB
If something goes wrong during deployment, especially when a user has force-unlocked due to a previous issue and then multiple apply actions are happening at once, the digest value for the Terraform lock file in S3 can be incorrect. This lets us set the digest value to the correct value, as given by the error message of a previous Terraform command, without having to go into the AWS console to set it manually.
Configuration menu - View commit details
-
Copy full SHA for 3eefba4 - Browse repository at this point
Copy the full SHA 3eefba4View commit details -
This currently relies on the binaries being installed locally. We may want to move to using the civiform formatter container instead, or something like it, in the future.
Configuration menu - View commit details
-
Copy full SHA for b444d9e - Browse repository at this point
Copy the full SHA b444d9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8defbc2 - Browse repository at this point
Copy the full SHA 8defbc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d48cbb9 - Browse repository at this point
Copy the full SHA d48cbb9View commit details -
Perform fixes during the run if running interactively
If we hit a TF lock state issue, or the S3 digest issue, this allows the user to fix the problem during this particular invocation of the command, so they do not need to rerun the command. If we are not running in a TTY, we'll fall back to prompting the user to rerun the command with the appropriate flag.
Configuration menu - View commit details
-
Copy full SHA for cf00e08 - Browse repository at this point
Copy the full SHA cf00e08View commit details -
Configuration menu - View commit details
-
Copy full SHA for acffcdc - Browse repository at this point
Copy the full SHA acffcdcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 42235a7 - Browse repository at this point
Copy the full SHA 42235a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for cadc160 - Browse repository at this point
Copy the full SHA cadc160View commit details -
Change to using env vars instead of flags when rerunning a command to…
… fix a problem This allows us not to have to change a CE's fork of civiform-deploy.
Configuration menu - View commit details
-
Copy full SHA for ce693fb - Browse repository at this point
Copy the full SHA ce693fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d0f21c - Browse repository at this point
Copy the full SHA 1d0f21cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 468c984 - Browse repository at this point
Copy the full SHA 468c984View commit details -
Configuration menu - View commit details
-
Copy full SHA for a129878 - Browse repository at this point
Copy the full SHA a129878View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.