Keeping Secrets Out of Terraform State: Ephemeral Resources and Write-Only Arguments
Marking a value sensitive hides it on the console and still writes it to state. Ephemeral resources and write-only arguments let a secret pass through a run without being recorded. The same secret created both ways on Terraform 1.14 and OpenTofu 1.11, with every file searched for it afterwards.