Day 5 - Terraform Variables
Content Today felt different. Terraform started feeling less like writing config and more like writing logic. Until now I was hardcoding values. Today I learned how to pass values, build them, and get them back using variables. There are 3 types Input variables Local variables Output variables At first it was confusing, but once I ran it myself, it made sense. What I built I created a simple S3 bucket using variables instead of hardcoding the name. To understand variables better, I created a small setup with multiple Terraform files. I used separate files for input variables, local values, main resource creation, and outputs. I also added tfvars files to test different environments like development and production. What I tested I tried a few things to understand how variables behave. First I ran normally using terraform.tfvars Terraform picked those values automatically Then I removed tfvars and ran again Terraform used default values from variables.tf Then ...