- Terraform Weekly
- Posts
- weekly.tf - Issue #62 - Terraform variables, AWS Budgets, Backups with Lambda
weekly.tf - Issue #62 - Terraform variables, AWS Budgets, Backups with Lambda
Terraform Variables
The concept of variables is simple enough to explain to kids at school (try it). It is easy to grasp but not to use in Terraform if you are an adventurous person who has experience with other programming languages (Terraform is not a programming language).
Treat variables much simpler because there is no real validation (am I wrong?), and you can't use variables in many parts of the configurations (depends_on, providers, backend, etc.).
Bonus point if your code does not rely on any experimental features introduced since 0.14 (behavior can be changed or dropped). Some potentially helpful experiments (enormously depending on your needs): optional arguments in objects (issue #19898) and defaults() function.
Dear HashiCorp, can we know when the existing experiments will be summarized? Terraform 0.14 was released in December 2020. Terraform was 15% younger and fitter back then.
Some thoughts about variables by Lachlan White (HashiCorp Ambassador, Technologist, Terraformer & Continuous Learner).
Sometimes, overriding variables in Terraform are needed for testing or using code outside its intended usage patterns. Tom Howarth (HashiCorp Ambassador) explains how.
Luthfi Anandra explains how to set up billing monitoring on AWS with Terraform. It is very simple, in fact.
Mario Dagrada explains how you can do database backups using AWS Lambda with Terraform (using Terraform AWS Lambda module). AB: Very detailed article where I would probably add that it is important to define a reserved concurrency to avoid multiple runs at once.
Open-source project(s)
CLI tool that checks Terraform code for module updates. AB: There is no module management capabilities built-in in the Terraform, yet. This kind of tool can be very handy. It definitely deserves a star on GitHub!
Feedback ❤️
Do you like this newsletter? How about sharing it on social media and providing your feedback to me (e.g., @antonbabenko or reply to the email). I want to know it!