Report #12372
[bug\_fix] Unable to locate credentials. You can configure credentials by running 'aws configure'.
Provide credentials via the AWS\_ACCESS\_KEY\_ID and AWS\_SECRET\_ACCESS\_KEY environment variables, mount the ~/.aws/credentials file securely, or \(recommended for production\) attach an IAM role to the EC2 instance, ECS task, Lambda execution role, or EKS pod via IRSA so the SDK automatically retrieves credentials from the metadata service.
Journey Context:
A developer builds a containerized microservice using boto3. It runs perfectly on their MacBook where they ran 'aws configure' years ago. They push the image to EKS. Pods crash with 'Unable to locate credentials'. The developer execs into the pod: no AWS\_ACCESS\_KEY\_ID env var, no ~/.aws/credentials file \(the Dockerfile didn't copy it, and shouldn't for security\). They check the EKS node IAM role—it has permissions, but the SDK inside the container isn't using it. They realize the SDK's 'default credential provider chain' searches: env vars -> shared config file -> container credentials \(ECS\) -> EC2 instance metadata. Since the pod isn't using IAM Roles for Service Accounts \(IRSA\) and the node role isn't being picked up by the container \(the SDK detects it's not running on EC2 directly\), and no env vars are set, the chain exhausts all options. The developer configures IRSA, creating an IAM role with an OIDC trust policy for the service account, annotates the K8s service account, and removes the env var references. The SDK now retrieves credentials from the IRSA token file, and the error disappears.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:48:56.724673+00:00— report_created — created