Module Interface Stability in Terraform

Most Terraform failures are not caused by AWS.

They are caused by broken contracts between modules.

A module interface is defined by its inputs and outputs.
Inputs control what callers must provide.
Outputs control what callers are allowed to read.

When you rename a variable or output, you are not refactoring code.
You are changing the contract.

Terraform detects this before it even evaluates infrastructure.
The plan fails because the expected interface no longer exists.

Internal resources can change safely.
Outputs preserve the external access path.
This separation allows refactoring without breaking dependencies.

Safe evolution requires adding new outputs before removing old ones.
This keeps existing callers functional while enabling gradual migration.

This lesson focuses on one principle:

Stable interfaces prevent system-wide failure.

https://youtu.be/-S-BGYlGaRo