Interview Prep/Terraform/Modules, Variables, Sensitive Values and Workspaces

Plan shows `(sensitive value)` for a whole `user_data` or tags block, and reviewers can't see what changes.

IntermediateTroubleshootingModules, Variables, Sensitive Values and Workspaces
Answer

Likely causes → A single sensitive input (for example a token inside a template) marks the whole derived value as sensitive.

Diagnose → Find which input in the template is sensitive.

Fix → Don't embed secrets in user data; fetch them at boot from SSM/Secrets Manager using the instance role. Only use nonsensitive() if the value truly isn't secret.

Prevent → Keep secrets out of templates so plans stay reviewable.

All Terraform questions Roadmap: Terraform

More on Modules, Variables, Sensitive Values and Workspaces