* These same credentials are used when working with the AWS CLI.
*
* You can find more information on the AWS profiles config file here:
* http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
*/
AWSCredentialsProvider credentialsProvider = new ProfileCredentialsProvider();
if (credentialsProvider.getCredentials() == null) {
File configFile = new File(System.getProperty("user.home"), ".aws/config");
throw new RuntimeException("No AWS security credentials found:\n"
+ "Make sure you've configured your credentials in: " + configFile.getAbsolutePath() + "\n"
+ "For more information on configuring your credentials, see "
+ "http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html");