Key Terraform Block Attributes
Always lock your modules to a specific
For Registry modules, append
version or ref to avoid unintended upgrades.For Registry modules, append
?version=, and for Git sources, use ?ref=.1. Defining the Source
Thesource attribute tells Terragrunt where to fetch Terraform code. You can reference:
- Terraform Registry Modules
- Git Repositories (HTTPS or SSH)
- Local Directories
1.1 Terraform Registry
1.2 GitHub (HTTPS)
1.3 GitHub (SSH)
1.4 Local Modules
Ideal for local development and testing:2. Passing Extra Arguments
Useextra_arguments to pass flags, variable files, or arbitrary flags to Terraform:
3. Hooks and Custom Commands
Hooks allow you to run scripts before or after Terraform commands:Use hooks carefully in production: unexpected script failures can block Terraform runs.
Always test hooks in a development environment first.
Always test hooks in a development environment first.