A developer is deploying a containerized application to AWS and wants to use the AWS SDK to interact with Amazon S3. To ensure security and flexibility across environments, the developer decides to use the Default Credential Provider Chain to locate AWS credentials.
Which two of the following locations or sources are checked by the Default Credential Provider Chain to obtain these credentials?
- Environment variables such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEYAnswer
- IAM role credentials retrieved from the Amazon EC2 instance metadata service (IMDS)Answer
- CHardcoded credentials specified directly within the SDK client constructor code
- DA credentials file stored in a private Amazon S3 bucket configured in the application parameters
- EAn encrypted parameter in AWS Systems Manager Parameter Store retrieved via an explicit API call
Answer
The correct options are the environment variables (such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) and the IAM role credentials retrieved from the Amazon EC2 instance metadata service (IMDS).
The default credential provider chain automatically searches several locations in a specific order to resolve credentials. Among these, it checks environment variables (such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) first, and if no credentials are found in earlier locations, it queries the instance metadata service (IMDS) for credentials associated with an IAM role.
Step-by-Step Solution
Key Concept
AWS SDK Default Credential Provider Chain Search Order