AWS tips
AWS_PROFILE
The AWS SDKs look for the credentials in order:
- In the Java system properties:
aws.accessKeyId
andaws.secretAccessKey
. - In system environment variables:
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
. - In the default credentials file (the location of this file varies by platform).
- In the Amazon ECS environment variable:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
. - In the instance profile credentials, which exist within the instance metadata associated with the IAM role for the Amazon EC2 instance.
It is also possible to use a credentials profile to use a specific profile (the AWS SDKs are looking at default
profile by default).
You cannot use the `AWS_PROFILE` along with the environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` as they will be in conflict, and the AWS SDK will use the env variables since they are higher in the priority order.
If you use the Java AWS SDK, in order to use this feature, you will need to add the dependency to `sts`:
~~~xml
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sts</artifactId>
</dependency>
~~~