Exam Terraform-Associate-003 Topic 5 Question 124 Discussion
Actual exam question for HashiCorp's Terraform-Associate-003 exam
Question #: 124
Topic #: 5
Question #: 124
Topic #: 5
Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?
Suggested Answer: A Vote an answer
This command will initialize the new backend and prompt you to migrate the existing state file to the new location4. The other commands are not relevant for this task.
by None at Jun 10, 2024, 12:37 PM
0
0
0
10
Comments
Uknown69CYP
2025-03-22 11:28:50Migrate the state file
Once you have authenticated to Terraform Cloud, you're ready to migrate your local state file to Terraform Cloud. To begin the migration, reinitialize. This causes Terraform to recognize your cloud block configuration.
$ terraform init
Initializing Terraform Cloud...
Do you wish to proceed?
As part of migrating to Terraform Cloud, Terraform can optionally copy your
current workspace state to the configured Terraform Cloud workspace.
Answer "yes" to copy the latest state snapshot to the configured
Terraform Cloud workspace.
Answer "no" to ignore the existing state and just activate the configured
Terraform Cloud workspace with its existing state, if any.
Should Terraform migrate your existing state?
Enter a value:
Copy
During reinitialization, Terraform presents a prompt saying that it will copy the state file to your Terraform Cloud workspace. Enter yes and Terraform will migrate the state from your local machine to Terraform Cloud.
None
2024-06-10 12:37:04Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).