#Module
2 posts
Terraform in Practice #9 Environment Separation: Workspace Limits, Directory Layout, and moved Refactoring
Examining where the workspace approach falls short for environment separation, then setting up the standard practical layout that splits code into modules and envs directories. We refactor the code that grew in a single directory into network, compute, and data modules, using moved blocks to relocate addresses without recreating anything, and finish with dev and prod running the same modules with different values.
Terraform Basics #8 Module Basics: Reusing Resource Bundles and Registry Modules
Starting from the fact that every Terraform directory is already a module, we build a child module that takes variables as inputs and outputs as results, and call it with a module block. We also cover pulling battle-tested modules from the registry with version pinning, plus the criteria for splitting modules and where over-splitting begins.