Interview Prep/Terraform/Providers, Resources and Data Sources

In what order does the AWS provider look for credentials?

IntermediateConceptProviders, Resources and Data Sources
Answer

Arguments in the provider block first, then environment variables (AWS_ACCESS_KEY_ID, AWS_PROFILE), then shared credentials and config files, then container or EC2 instance metadata roles. In CI we use OIDC to assume a role, so no long-lived keys exist anywhere. assume_role in the provider block handles cross-account access.

All Terraform questions Roadmap: Terraform

More on Providers, Resources and Data Sources