You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to orchestrate a state migration via CI using init -migrate-state. The issue is:
In the simple case (empty destination state) I want to permit the migration in a headless fashion (like -force was passed, no input required)
In the complex case (non-empty destination state) I want the migration to fail; humans will need to resolve this before trying again.
Attempted Solutions
As far as I know there's no solution entirely within terraform. My current plan is to manually copy the state from the source to the destination, checking for and forbidding an overwrite, before calling terraform (in a normal fashion; TF won't know in this scenario that a migration happened).
Proposal
The most complex version of this might be to have some sort of generic functionality to agree to specific input prompts without agreeing to others; for example, if the prompt ID was split into backend-migrate-to-backend-empty and backend-migrate-to-backend-nonempty, and also if I could agree to specific prompts like -input=backend-migrate-to-backend-empty=true -input=false that would solve the problem in a really complete fashion.
The simplest version of this might be something like -migrate-state=if-empty or something like that.
References
I didn't find anything addressing this case.
The text was updated successfully, but these errors were encountered:
Terraform Version
but I've diff'd internal/command/meta_backend_migrate.go between 1.1.9 and main and there haven't been any relevant changes to the flow since then.
Use Cases
I'm trying to orchestrate a state migration via CI using
init -migrate-state
. The issue is:Attempted Solutions
As far as I know there's no solution entirely within terraform. My current plan is to manually copy the state from the source to the destination, checking for and forbidding an overwrite, before calling terraform (in a normal fashion; TF won't know in this scenario that a migration happened).
Proposal
The most complex version of this might be to have some sort of generic functionality to agree to specific input prompts without agreeing to others; for example, if the prompt ID was split into
backend-migrate-to-backend-empty
andbackend-migrate-to-backend-nonempty
, and also if I could agree to specific prompts like-input=backend-migrate-to-backend-empty=true -input=false
that would solve the problem in a really complete fashion.The simplest version of this might be something like
-migrate-state=if-empty
or something like that.References
I didn't find anything addressing this case.
The text was updated successfully, but these errors were encountered: