What file extension is used for Terraform configuration files?

Prepare for your Terraform Associate Exam with our engaging quiz. Test your knowledge with multiple choice questions and receive detailed explanations to enhance your understanding. Ace your exam with confidence!

Terraform configuration files use the .tf file extension. This extension is specifically designed for files that contain the infrastructure as code written in HashiCorp Configuration Language (HCL) or JSON. These files define the desired state of your infrastructure, including resources, variables, and configurations necessary to provision and manage infrastructure using Terraform.

While other options suggest related concepts, they do not represent configuration files. The .tfstate file extension is associated with the state files that Terraform generates to keep track of the current state of the infrastructure managed by Terraform. The .terraform directory is where Terraform stores some of its internal data but does not pertain to configuration files. The .hcl file extension can also be used for configuration, particularly when using HCL syntax in files without the standard .tf extension, but it is less common in practice for Terraform configurations.

Therefore, the .tf extension is the standard and correct designation for Terraform configuration files, making it essential for defining the infrastructure in a manner that Terraform can utilize to achieve the desired setup.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy