Skill 4.8.3

Write-only arguments

Key Concepts

Some resource arguments are write-only, introduced in Terraform 1.11. They accept ephemeral or regular values, send them to the provider during apply and never persist them in plan or state; their name usually ends in _wo, such as a database resource's password_wo. Because Terraform keeps no copy, it cannot detect when the value changes.

Write-only arguments therefore come with a version argument, such as password_wo_version. Terraform stores the version, and when you increase it, Terraform sends the current write-only value again. Combined with an ephemeral resource that generates or fetches the secret, this keeps the secret out of state entirely.