Skip to content

Commit 861cc45

Browse files
committed
fix: address blog date issue + add TOC
1 parent 9f57609 commit 861cc45

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

content/blog/standard-tf-files.md renamed to content/blog/2025-10-06-standard-tf-files.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,31 @@ draft: false
44
title: "The Standard Terraform and OpenTofu Files + Their Uses"
55
author: Matt Gowie
66
slug: standard-tf-files
7-
date: 2025-10-07
7+
date: 2025-10-06
88
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."
99
image: /img/updates/standard-tf-files.png
1010
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>
1111
---
1212

13+
<h2>Table of Contents</h2>
14+
15+
- [Core Configuration Files](#core-configuration-files)
16+
- [main.tf: Resource Definitions and Primary Infrastructure](#maintf-resource-definitions-and-primary-infrastructure)
17+
- [variables.tf: Input Variable Declarations](#variablestf-input-variable-declarations)
18+
- [outputs.tf: Exporting Values](#outputstf-exporting-values)
19+
- [data.tf: External Data Source Queries](#datatf-external-data-source-queries)
20+
- [checks.tf: Resource-Level Validation and Policies](#checkstf-resource-level-validation-and-policies)
21+
- [imports.tf: Resource Import Declarations](#importstf-resource-import-declarations)
22+
- [Supporting Configuration Files](#supporting-configuration-files)
23+
- [providers.tf: Managing Provider Configurations](#providerstf-managing-provider-configurations)
24+
- [versions.tf: Terraform and Provider Requirements](#versionstf-terraform-and-provider-requirements)
25+
- [.terraform.lock.hcl: The Dependency Lock File](#terraformlockhcl-the-dependency-lock-file)
26+
- [Advanced TF File Usage](#advanced-tf-file-usage)
27+
- [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+
1332
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.
1433

1534
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

Comments
 (0)