DevOps Classroom notes 08/Aug/2026

Terraform Files Structure

A standard Terraform project is organized into multiple .tf files, with each file typically having a specific responsibility. Terraform automatically loads and merges all .tf files in the same directory. The separation is mainly for readability and organization, not functionality.

Common Terraform Files

  • main.tf — Primary file for defining resources.
  • *.tf — Other Terraform configuration files. You can split resources and configurations across multiple .tf files as needed.
  • provider.tf — Defines provider configurations and provider-related settings.
  • outputs.tf — Defines output values that can be displayed or consumed by other modules.
  • variables.tf — Defines input variables.
  • terraform.tfvars — Provides values for input variables and can override their default values.
  • backend.tf — Configures where Terraform stores its state file, such as an Amazon S3 bucket or Azure Blob Storage.
  • modules/ — Contains reusable Terraform modules.
  • data.tf — Defines data sources used to retrieve information about existing resources or external data.

Note: Terraform does not require these specific filenames. You can use any .tf filenames you prefer. Terraform loads all .tf files in the same directory automatically.

Watch the Class Recording and Create Network Resources

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube