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.
More on Providers, Resources and Data Sources
What is a resource block and how is it addressed?BeginnerWhat is the difference between a resource and a data source?BeginnerHow do you configure a provider such as AWS?BeginnerHow do you use the same provider with multiple regions or accounts?IntermediateWhat does `default_tags` in the AWS provider do and what are its pitfalls?IntermediateWhat is the difference between arguments and attributes?Beginner