Module 4 of 8
Terraform Configuration
Why this module is the largest: it holds the most objectives and most of 004's new emphasis: depends_on (4f), custom conditions (4g), and ephemeral values and write-only arguments (4h).
Learning objectives
| ID | You will be able to… |
|---|---|
| 4a | Choose between resource and data blocks, explain when data sources are read, and use terraform_data. |
| 4b | Write references to resource, data, variable, local, and module values, including indexed instances. |
| 4c | Declare variables and outputs, apply the variable precedence order, and use sensitive, nullable, and ephemeral. |
| 4d | Use list, set, map, object, and tuple types, optional() attributes, and explain type conversion. |
| 4e | Write for expressions, splats, conditionals, dynamic blocks, and locals, use built-in functions, and test expressions in terraform console. |
| 4f | Explain implicit vs. explicit dependencies, and use count, for_each, depends_on, provider, and lifecycle. |
| 4g | Write variable validation, preconditions, postconditions, and check blocks, and predict whether each blocks the run or only warns. |
| 4h | Explain where secrets end up, and keep them out of state using ephemeral values, ephemeral resources, write-only arguments, Vault, and dynamic credentials. |
In this module
- Lesson 4.1: Resource vs. Data Blocks (4a)
- Lesson 4.2: References and Cross-Resource Dependencies (4b)
- Lesson 4.3: Variables and Outputs (4c)
- Lesson 4.4: Complex Types (4d)
- Lesson 4.5: Expressions, Functions, and the Console (4e)
- Lesson 4.6: Dependencies and Meta-Arguments (4f)
- Lesson 4.7: Custom Conditions (4g)
- Lesson 4.8: Managing Sensitive Data (4h)
- Lab 4A: Variables, Types, Expressions, and the Console (25 min)
- Lab 4B: count, for_each, depends_on, and lifecycle (25 min)
- Lab 4C: Custom Conditions (20 min)
- Lab 4D: Secrets, Vault, Ephemeral Values, and Write-Only Arguments (25 min)
- Knowledge Check 4 (10 questions)
- Cheat Sheet 4: Terraform Configuration