Credential provider chain

如果在机器上即绑定了EC2 Role,又配置了AK/SK, 又配置了环境变量,那么会遵循以下顺序:

  • 首先找~/.aws/credentials
  • 再找IAM Role
  • 再找环境变量AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY