Introduction
Sometimes you want to set a value in your infrastructure code but also want to have a backup value if nothing is given. Default values let you do this so your code works smoothly even if you forget to provide some inputs.
When you want to create a reusable module that can work with or without specific input values.
When you want to avoid errors caused by missing input variables in your Terraform configuration.
When you want to provide a common setting but allow users to override it if needed.
When you want to simplify your Terraform commands by not requiring all variables every time.
When you want to ensure your infrastructure has safe fallback values to prevent misconfiguration.