Interview Prep/Terraform/Providers, Resources and Data Sources

How do you configure a provider such as AWS?

BeginnerConceptProviders, Resources and Data Sources
Answer

Declare it in required_providers and add a provider block for settings like region. Credentials should come from the environment, shared config, SSO or an assumed role, never from literals in code.

provider "aws" {
  region = "ap-south-1"
  default_tags { tags = { ManagedBy = "terraform" } }
}
All Terraform questions Roadmap: Terraform

More on Providers, Resources and Data Sources