Join us for live office hours! Next WednesdayNext Wed
Terraform Modules
← Back to Glossary
Infrastructure as Code

What is Terraform Modules?

Terraform modules are reusable, self-contained packages of Terraform configuration that encapsulate related resources into a single logical unit for consistent infrastructure provisioning.

How Terraform Modules Work

A Terraform module is a directory containing .tf files that define a set of related resources. The root module is the directory where you run terraform apply. Child modules are called from the root module using module blocks.

Modules accept input variables, create resources, and expose output values—forming a clean interface for infrastructure components.

Module Types

  • Root modules — the top-level configuration that Terraform executes directly
  • Child modules — reusable packages called from root modules
  • Published modules — shared via the Terraform Registry or private registries

Best Practices

  • Keep modules focused on a single concern (e.g., one module for VPC, another for EKS)
  • Use semantic versioning for published modules
  • Pin module versions in production configurations
  • Provide sensible defaults while allowing overrides
  • Include examples and documentation with every module

Cloud Posse Module Library

Cloud Posse maintains hundreds of production-ready Terraform modules covering AWS services from VPC networking to EKS clusters, IAM policies, and monitoring. These modules follow consistent patterns for naming, tagging, and configuration, making them composable building blocks for enterprise infrastructure.

Related Terms

TerraformTerraform StateInfrastructure as Code

Related Articles

The Role of Open Source Module Libraries in a Post-AI World

Open source Terraform module libraries are infrastructure's equivalent of npm and PyPI—battle-tested foundations that become even more critical when AI enters the picture.

Feb 17 2026

Own Your Infrastructure

AI leveled the playing field. You don't need vendor platforms anymore. Here's what real infrastructure ownership looks like and why it's your strategic advantage.

Feb 15 2026

Why Terraform Is More Relevant Than Ever in the AI Era

Generative AI doesn't replace infrastructure as code—it supercharges it. Here's why IaC is the perfect foundation for agentic development.

Jan 28 2026

Service-Oriented Terraform: Why the Patterns That Work for Software Work for Infrastructure

Infrastructure as Code follows the same architectural principles software engineering established decades ago. Here's why service-oriented patterns aren't workarounds—they're the right way to build.

Nov 30 2025

Building Enterprise-Grade Terraform: A Practical Guide

Ready to build enterprise-grade Terraform? This guide covers the architectural patterns, governance frameworks, and practical implementation steps that successful teams use to balance compliance with team autonomy.

Nov 15 2025

The Production Ready Newsletter

Build Smarter. Avoid Mistakes. Stay Ahead of DevOps Trends That Matter.

The fastest way to achieve SOC 2 on AWS with Terraform and GitHub Actions.

For Developers

  • GitHub
  • Documentation
  • Quickstart Docs
  • Resources
  • Read our Blog

Community

  • Join Office Hours
  • Join the Slack Community
  • DevOps Podcast
  • Try our Newsletter

Company

  • Services & Support
  • AWS Migrations
  • Pricing
  • Book a Meeting

Legal

  • Terms of Use
  • Privacy Policy
  • Disclaimer
  • Cookie Policy
Copyright ©2026 Cloud Posse, LLC. All rights reserved.