QuestionQ22

Terraform state management

What is the purpose of the .terraform directory in a Terraform workspace?

  • A The directory contains plugins and modules that Terraform downloads during initialization, along with other important information.
  • B The directory contains the provide credentials and the .tfvars files to prevent them from being committed to version control by accident.
  • C The directory is where Terraform creates and maintains the state file to track the underlying resources it creates and manages.
  • D The directory is used to convert and store Terraform configuration files into API calls to communicate with the targeted platform.
Explanation

Terraform automatically creates and manages the .terraform directory during initialization to store cached provider plugins and modules, along with workspace and backend-related metadata. Terraform state is stored separately, either in a local state file or in the configured backend.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!