DEV Community

Cover image for Did You Know? IAM precedence
Rola Dali
Rola Dali

Posted on

Did You Know? IAM precedence

Do you have several AWS credentials and are confused which one is being used?

AWS has a defined Default Credential Provider Chain which dictates the order of which credentials it uses in the case where there are several.

The Default Credential Provider Chain Order for Java SDK is:

  1. Environment variables: "AWS_ACCESS_KEY_ID" and "AWS_SECRET_ACCESS_KEY".
  2. Java system properties: aws.accessKeyId and aws.secretAccessKey.
  3. Web Identity Token credentials from the environment or container.
  4. The default credential profiles file: typically located at ~/.aws/credentials
  5. Amazon ECS container credentials: loaded from the Amazon ECS if the environment variable AWS_\CONTAINER_CREDENTIALS_RELATIVE_URI is set.
  6. Instance profile credentials: used on EC2 instances, and delivered through the Amazon EC2 metadata service.

Reference

Now You Know!

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay