Remote state and Locking using Terraform

Before diving into the subject of “Remote State”, let's ask a fundamental/basic question!
We use Terraform to create, update or destroy our resources in the cloud (AWS). But how did Terraform know which resources it had been alleged to manage?
The answer is “terraform. tfstate”. Think “Terraform. tfstate” file as a database to Terraform, where Terraform keeps a map of…