Domain 4 of 8 · Chapter 8 of 8

Managing sensitive data

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing HashiCorp Certified: Terraform Associate premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • Where secrets leak, and what each tool closes
  • sensitive: redact output, not state
  • Keep it out of state: ephemeral and write-only
  • Sourcing secrets from Vault at runtime
  • How this appears on the exam

Which exposure each mechanism closes

Propertysensitive = trueEphemeral / write-onlyVault provider (data source)
Hidden from CLI and UI outputYes, value redactedYes, value never shownNo on its own; mark it sensitive
Kept out of state and plan filesNo, stored in plaintextYes, never persistedNo; the read value lands in state
Secret lives outside the configurationNo, value still in config or varsOnly if an ephemeral resource generates itYes, fetched from Vault at runtime
Minimum Terraform versionAny versionv1.10 ephemeral, v1.11 write-onlyAny (a provider feature)

Decision tree

Keep this value out of state?Provider has a _wo argument?Only a display concern?YesNoWrite-only argumentfed by an ephemeral resourceEphemeral valueused in an ephemeral contextsensitive = trueredacts output onlyProtect the state fileremote backend, encrypt at restYesNoYesNoAcross all paths: fetch secrets from Vault at runtimeand prefer short-lived, dynamic credentials

Cheat sheet

  • sensitive redacts output only
  • State is plain text
  • Securing state
  • Ephemeral values omitted from state
  • Ephemeral usage contexts
  • Write-only arguments
  • Ephemeral resource block as a producer
  • Vault provider purpose
  • Vault secrets still land in state
  • Prefer short-lived credentials

Unlock with Premium — includes all practice exams and the complete study guide.

References

  1. Sensitive Data in State
  2. Input Variables
  3. Output Values
  4. Ephemeral Resources
  5. Reference ephemeral resources
  6. Write-only Arguments
  7. HashiCorp Vault Provider
  8. vault_generic_secret Data Source
  9. Vault Lease, Renew, and Revoke