Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 203


You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.

Which command will migrate your current state file to the new S3 remote backend?

Show Answer
Correct Answer: B

To migrate your current state file to a new S3 remote backend in Terraform, you would use the command 'terraform init'. This command initializes the working directory containing Terraform configuration files and sets up the backend, including migrating the Terraform state file to the backend specified in the configuration.

Discussion

5 comments
Sign in to comment
gekkehenkOption: B
Jan 14, 2023

Answer is correct, terraform init migrates the state.

nakikooOption: B
Jan 13, 2023

A. terraform state just state your .tf B. Terraform init synch with backend C. Refresh, refreshes config D. Push, not sure

ArizonaClassicsOption: B
Jan 13, 2023

I will go for B

Darshan07Option: B
Feb 28, 2024

I will go with B

enklauOption: B
Jul 21, 2024

terraform init -migrate-state