Section 5: Variables, Outputs and Configuration
- Declaring variables, types, defaults and validation rules
- Passing values through tfvars files, environment variables and the command line
- Using outputs to expose values and locals to reduce repetition
- Lab: refactor hardcoded configuration into variables and outputs
Section 6: Reusable Modules
- Module concepts and designing for reuse across projects
- Writing your own modules and consuming modules from the Terraform Registry
- Structuring a project so it stays readable and maintainable
- Lab: split the code into a module and reuse it across two environments
Section 7: Multiple Environments (Dev, Staging, Prod)
- Separating environments with workspaces versus directory structure
- Managing environment-specific values safely
- Naming and tagging conventions that make cost tracking possible
- Lab: build dev and prod environments from one codebase
Section 8: Remote State and Team Collaboration
- Storing state in a remote backend and why teams need it
- State locking to prevent concurrent changes from corrupting state
- Team workflow: branches, pull requests and reviewing plan output before apply
- Lab: migrate state to a remote backend and test locking with concurrent runs