You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/2025-10-06-standard-tf-files.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,31 @@ draft: false
4
4
title: "The Standard Terraform and OpenTofu Files + Their Uses"
5
5
author: Matt Gowie
6
6
slug: standard-tf-files
7
-
date: 2025-10-07
7
+
date: 2025-10-06
8
8
description: "A comprehensive guide to the various files that make up a Terraform and OpenTofu project. Learn what belongs in main.tf, variables.tf, outputs.tf, and other essential files for maintainable Infrastructure as Code."
9
9
image: /img/updates/standard-tf-files.png
10
10
callout: <p>👋 <b>If your team is struggling with inconsistent Terraform organization or looking to establish better practices for Infrastructure as Code, we'd love to help. To discuss how we can support your infrastructure goals with proven patterns and strategies, <a href='/contact'>get in touch!</a></b></p>
-[Locals and Their Placement](#locals-and-their-placement)
28
+
-[When to Create Additional .tf Files](#when-to-create-additional-tf-files)
29
+
-[Using context.tf for Project Metadata](#using-contexttf-for-project-metadata)
30
+
-[Conclusion](#conclusion)
31
+
13
32
If you've hopped between different Terraform or OpenTofu (collectively referred to as TF going forward in this post) projects across teams, you've definitely seen this problem: everyone organizes their TF files differently. Some teams jam everything into a single main.tf file, while others scatter resources across dozens of specialized files. This isn't just an aesthetic issue — it creates real headaches when you're trying to understand or fix infrastructure code.
14
33
15
34
When you join a new project, your first days often aren't spent making useful changes. Instead, you're decoding how this particular team decided to organize their TF code. Even worse, within a single codebase, different contributors frequently follow completely different organizational patterns, creating a confusing patchwork that slows everyone down.
0 commit comments