nerdexam
HashiCorpHashiCorp

TA-002-P · Question #300

TA-002-P Question #300: Real Exam Question with Answer & Explanation

The correct answer is A: modify state. The terraform state command is used to modify state, with subcommands like mv, rm, and replace-provider enabling direct state manipulation.

Implement and maintain state

Question

Complete the following sentence: The terraform state command can be used to ____

Options

  • Amodify state
  • Bview state
  • Crefresh state
  • DThere is no such command

Explanation

The terraform state command is used to modify state, with subcommands like mv, rm, and replace-provider enabling direct state manipulation.

Common mistakes.

  • B. While terraform state list and terraform state show can display state content, 'view state' understates the command's primary purpose, which is direct state modification.
  • C. Refreshing state is performed with terraform refresh or terraform apply -refresh-only, not with the terraform state command.
  • D. terraform state is a valid, well-documented, and widely used Terraform CLI command with multiple subcommands.

Concept tested. Terraform state command subcommands for state modification

Reference. https://developer.hashicorp.com/terraform/cli/commands/state

Topics

#terraform state#state management#CLI commands#state modification

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions