Terraform & IaC
Module contracts
A module's input variables and output values form its contract with callers, so renaming an output or removing an input breaks callers even when the module code is correct.
What you will be able to do
- Explain which parts of a module are its contract with callers.
- Decide how to change or retire a module input or output without breaking callers.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Terraform & IaC
- count indexingIntermediate · 4 min
count identifies instances by index, so reordering or removing a list item can change which live object each index points to, and the plan can replace them.
- Import existing resourcesAdvanced · 4 min
Import records an existing object in state without changing it, and a clean plan afterwards shows the configuration matches the real object so the team can manage it.
- Output sensitivityAdvanced · 4 min
A sensitive output is hidden on screen and in logs, but Terraform still stores the value in state, so the state store and the CI logs need the real protection.
- Secret handlingAdvanced · 5 min
Secrets in Terraform reach state and plan files even when they are marked sensitive, so a handling plan must cover where values are stored, who can read them and how…
- Provider aliasesAdvanced · 4 min
Provider aliases give one provider several configurations, and resources and modules must pick one explicitly because the default is used without warning when they do…
- Multi account providersAdvanced · 4 min
Multi-account Terraform works when each provider configuration assumes a role in its own account, because an assumed session carries that role's permissions and then…