Clearing a Common Beginner Confusion (with Real Examples)


Introduction

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.


The Confusion I Faced

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: