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

Add the ability to migrate terraform state #154

Open
verbanicm opened this issue Jul 19, 2023 · 0 comments
Open

Add the ability to migrate terraform state #154

verbanicm opened this issue Jul 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@verbanicm
Copy link
Contributor

verbanicm commented Jul 19, 2023

TL;DR

Provide the ability for users to inform guardian that the state file needs to be migrated.

Detailed design

Use PR body comments to determine if the -migrate-state flag should be used in the terraform init command.

This would require two phases:

  1. Checkout the main branch, run terraform init
  2. Checkout the PR branch, run terraform init -migrate-state
    • This would leave the existing state intact, so if the plan/apply failed, it would be a no-op
  3. Continue with the plan and apply

There should be a separate and distinct step to remove the old state file after a successful plan and apply.

Alternatives considered

No response

Additional information

No response

@verbanicm verbanicm added the enhancement New feature or request label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant