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

Which newer string functions replace clumsy regex checks?

IntermediateConceptLoops, Conditionals, Dynamic Blocks and Functions
Answer

startswith(str, prefix) and endswith (1.3), strcontains(str, substr) (1.5), plus trimprefix, trimsuffix and format. They make validations readable and avoid regex mistakes.

condition = startswith(var.bucket_name, "acme-") && !strcontains(var.bucket_name, "_")
All Terraform questions Roadmap: Terraform

More on Loops, Conditionals, Dynamic Blocks and Functions