AWS tips

AWS_PROFILE

The AWS SDKs look for the credentials in order:

  1. In the Java system properties: aws.accessKeyId and aws.secretAccessKey.
  2. In system environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
  3. In the default credentials file (the location of this file varies by platform).
  4. In the Amazon ECS environment variable: AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.
  5. 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>
~~~