nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #141

Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?

The correct answer is A. terraform destroy, then terraform apply. This command will initialize the new backend and prompt you to migrate the existing state file to the new location. The other commands are not relevant for this task.

Implement and Maintain State

Question

Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?

Options

  • Aterraform destroy, then terraform apply
  • Bterraform init
  • Cterraform push
  • Dterraform apply

How the community answered

(26 responses)
  • A
    81% (21)
  • B
    4% (1)
  • C
    4% (1)
  • D
    12% (3)

Explanation

This command will initialize the new backend and prompt you to migrate the existing state file to the new location. The other commands are not relevant for this task.

Topics

#backend migration#terraform init#state migration#backend configuration

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice