
Terraform Lab: Modules, Outputs, Root vs Child, Structure, Multiple Providers, Workspaces
In this lab you will learn how to build Terraform modules the way real organizations do. You will practice: creating reusable child modules calling them from the root module exposing values using outputs using multiple AWS providers switching environments using Terraform workspaces following a production-ready module structure understanding how modules are designed for real teams understanding how modules are published to the Terraform Registry PART 1 — What You Are Building You will build this architecture: network module creates a security group compute module creates an EC2 instance root module calls both modules creates an Elastic IP attaches the EIP to the EC2 instance using the module output multiple providers default AWS provider for one region aliased AWS provider for another region workspaces dev and prod use different instance types PART 2 — Why Module Outputs Matter Real production problem In real companies: one module creates networking another creates compute another creat
Continue reading on Dev.to Tutorial
Opens in a new tab


