Abusing Terraform Variable Validations for Science
One task I’ve recently encountered was refactoring Terraform configurations that had significantly drifted across environments. ➜ diff ./prod ./dev --exclude terraform.tfvars --brief | wc -l 58 oh my… The prod environment naturally has a tendency to include more resources or policies than the dev environment. Luckily the mental overhead of having two unique configurations is unnecessary. In principle, Terraform is a declarative configuration language. It employs several providers which abstract the more imperative elements such as error checking, validation, retries etc for creating your final requested configuration state....