When learning Terraform, one of the most confusing topics for beginners is understanding the relationship between:
I personally faced this confusion while creating an EC2 module and trying to reuse it across environments.
This document explains that exact confusion, why it happens, and how professionals actually solve it.
While creating an EC2 module, I wrote something like this inside the module:
provider "aws" {
region = "ap-south-2"
}
At first, this felt correct.
But then I started asking questions:
ap-south-2?eu-west-1?us-east-1?