nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #193

When do you need to explicitly execute Terraform in refresh-only mode?

The correct answer is C. Before every terraform import. Purpose of Refresh-Only Mode: Running Terraform in refresh-only mode updates Terraform's state file with the current state of resources in your infrastructure without making changes to the resources themselves. Context of Terraform Import: When using terraform import, you're…

Implement and Maintain State

Question

When do you need to explicitly execute Terraform in refresh-only mode?

Options

  • ABefore every terraform plan.
  • BBefore every terraform apply.
  • CBefore every terraform import.
  • DNone of the above.

How the community answered

(26 responses)
  • A
    8% (2)
  • B
    15% (4)
  • C
    73% (19)
  • D
    4% (1)

Explanation

Purpose of Refresh-Only Mode: Running Terraform in refresh-only mode updates Terraform's state file with the current state of resources in your infrastructure without making changes to the resources themselves. Context of Terraform Import: When using terraform import, you're adding existing resources to the state file, and running Terraform in refresh-only mode before this operation can ensure that any initial configuration syncs precisely with the actual state.

Topics

#refresh-only mode#terraform import#state sync#terraform workflow

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice