Exam Terraform Associate All QuestionsBrowse all questions from this 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?

    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
gekkehenkOption: B

Answer is correct, terraform init migrates the state.

enklauOption: B

terraform init -migrate-state

Darshan07Option: B

I will go with B

ArizonaClassicsOption: B

I will go for B

nakikooOption: B

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