Where have you put the IAM credentials on the EC2 machine?
If you have
AWS_SECRET_ACCESS_KEY in your environment you can use ‘env’, if they are attached to the EC2 machine (via an instance role) you can use ‘iam’ and default should catch all of these (I believe) in the following order of priority according to the DefaultProviderChain.
- Environment variables
- Java system properties (args)
- AWS profile (in ~/.aws/credentials)
- EC2 metadata service