You modified your Terraform configuration and switched from local backend to remote backend by modifying main.tf file. What do you need to migrate the local state to the remote backend?
Experience Level: Junior
Tags: Terraform
Answer
Run the following command:
terraform init
This way Terraform CLI will automatically run migration of local state to remote state using the configured remote backend.
Related Terraform job interview questions
What is a name of file that Terraform CLI uses for storing local state?
Terraform JuniorYou modified your Terraform configuration and removed the remote backend from main.tf file. Whan happens with Terraform state?
Terraform JuniorUsing Terraform CLI, how you upgrade all referenced modules and providers to versions allowed within configured constraints?
Terraform JuniorUsing Terraform CLI, how do you download module source codes in order to be able to look at how the module is implemented and copy the examples easily?
Terraform JuniorWhat does 'terraform init' command do?
Terraform Junior