|
| 1 | +# AWS Credentials |
| 2 | + |
| 3 | +Plugins that interact with AWS services will fetch credentials from various providers in the following order. |
| 4 | +Only the first provider that is able to provide credentials will be used. |
| 5 | + |
| 6 | +All AWS plugins additionally support a `role_arn` (or `AWS_ROLE_ARN`, for [Elasticsearch](../pipeline/outputs/elasticsearch.md)) configuration parameter. If specified, the fetched credentials will then be used to assume the given role. |
| 7 | + |
| 8 | +## 1. Environment Variables |
| 9 | + |
| 10 | +Uses the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (and optionally `AWS_SESSION_TOKEN`) environment variables if set. |
| 11 | + |
| 12 | +## 2. Shared Configuration and Credentials Files |
| 13 | + |
| 14 | +Reads the shared config file at `$AWS_CONFIG_FILE` (or `$HOME/.aws/config`) and the shared credentials file at `$AWS_SHARED_CREDENTIALS_FILE` (or `$HOME/.aws/credentials`) to fetch the credentials for the profile named `$AWS_PROFILE` or `$AWS_DEFAULT_PROFILE` (or "default"). See https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html. |
| 15 | + |
| 16 | +The shared settings will be evaluated in the following order. |
| 17 | + |
| 18 | +Setting|File|Description |
| 19 | +---|---|--- |
| 20 | +`credential_process`|config| See https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html.<br/>Supported on Linux only. |
| 21 | +`aws_access_key_id`<br/>`aws_secret_access_key`<br/>*`aws_session_token`*|credentials|Access key ID and secret key to use to authenticate.<br/>The session token must be set for temporary credentials. |
| 22 | + |
| 23 | +At this time, no other settings are supported. |
| 24 | + |
| 25 | +## 3. EKS Web Identity Token (OIDC) |
| 26 | + |
| 27 | +Fetches credentials via a signed web identity token for a Kubernetes service account. |
| 28 | +See https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html. |
| 29 | + |
| 30 | +## 4. ECS HTTP Credentials Endpoint |
| 31 | + |
| 32 | +Fetches credentials for the ECS task's role. |
| 33 | +See https://docs.aws.amazon.com/AmazonECS/latest/userguide/task-iam-roles.html. |
| 34 | + |
| 35 | +## 5. EC2 Instance Profile Credentials (IMDS) |
| 36 | + |
| 37 | +Fetches credentials for the EC2 instance profile's role. |
| 38 | +See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html. |
0 commit comments