I am attempting to migrate a Terraform project to use Terraspace to take advantage of the additional features.
I’ve copied my VPC resource into a folder within my stack directory. I copied in the .terraform & terraform.tfstate file.
I’d like to run the below and get it pick up my current remote state
AWS_REGION=eu-west-1 TS_ENV=new-schema terraspace plan vpc
However, I get the following error:
Building .terraspace-cache/eu-west-1/new-schema/stacks/vpc
Built in .terraspace-cache/eu-west-1/new-schema/stacks/vpc
Current directory: .terraspace-cache/eu-west-1/new-schema/stacks/vpc
=> terraform plan -input=false
╷
Terraform reinitialization required detected. Will run `terraform init` and try again.
=> terraform init -get -input=false >> /tmp/terraspace/log/init/vpc.log
╷
│ **Error:** **Backend configuration changed**
│
│ A change in the backend configuration has been detected, which may require
│ migrating existing state.
│
│ If you wish to attempt automatic migration of the state, use "terraform
│ init -migrate-state".
│ If you wish to store the current configuration with no changes to the
Terraform reinitialization required detected. Will run `terraform init` and try again.
=> terraform init -get -input=false >> /tmp/terraspace/log/init/vpc.log
attempt to run
AWS_REGION=eu-west-1 TS_ENV=new-schema terraspace init vpc
d get the exact same error as above:
Terraform reinitialization required detected. Will run `terraform init` and try again.
=> terraform init -get -input=false
**Initializing modules...**
**Initializing the backend...**
╷
│ **Error:** **Backend configuration changed**
│
│ A change in the backend configuration has been detected, which may require
│ migrating existing state.
│
│ If you wish to attempt automatic migration of the state, use "terraform
│ init -migrate-state".
│ If you wish to store the current configuration with no changes to the
ERROR after max retries 1: ╷
│ **Error:** **Backend configuration changed**
│
│ A change in the backend configuration has been detected, which may require
│ migrating existing state.
│
│ If you wish to attempt automatic migration of the state, use "terraform
│ init -migrate-state".
│ If you wish to store the current configuration with no changes to the
│ state, use "terraform init -reconfigure"
I successfully did this with an ECS stack that isn’t using a module so unsure if this is what is causing the issue. I also tried to cd into the stack and run terraform init
but no luck