Introduction
When you write infrastructure code, you want to use it many times without changing the main file. Variables help by letting you change values easily without rewriting the whole code. This saves time and reduces mistakes.
When you want to create the same infrastructure in different environments like testing and production with small changes.
When you need to share your infrastructure code with teammates who might use different settings.
When you want to avoid repeating the same values in many places in your code.
When you want to quickly update settings like server size or region without editing many files.
When you want to keep sensitive information like passwords separate from your main code.