terraform-google-modules / terraform-example-foundation

Shows how the CFT modules can be composed to build a secure cloud foundation
https://cloud.google.com/architecture/security-foundations
Apache License 2.0
1.18k stars 701 forks source link

add variable validation for essential_contacts_domains_to_allow #1261

Open eeaton opened 1 month ago

eeaton commented 1 month ago

TL;DR

Add variable validation rules for variables that are sensitive to unusual/non-intuitive requirements for the accepted format of string.

For example, essential_contacts_domains_to_allow is unusual in that it requires an ampersand, "@example.com". A string that doesn't exactly match this format will pass the plan stage but fail the apply stage. Catching these types of mistakes earlier can help reduce friction.

This is particularly disruptive for variables set in the global.tfvars file for the helper script, because correcting the global variables requires deleting everything and starting from a fresh deployment,

Terraform Resources

No response

Detailed design

No response

Additional information

anecdotally, I've seen a similar issue with project labels.