Interview Prep/Terraform/Loops, Conditionals, Dynamic Blocks and Functions

How do hashing and encoding functions behave with respect to state?

AdvancedConceptLoops, Conditionals, Dynamic Blocks and Functions
Answer

sha256, md5, base64encode, bcrypt are deterministic except bcrypt, which salts and so changes every plan. Their results, like all attribute values, are written to state; hashing a secret does not make the stored input safe. Use hashes for change detection, not secrecy.

All Terraform questions Roadmap: Terraform

More on Loops, Conditionals, Dynamic Blocks and Functions