Brandon Seet
Brandon Seet

Reputation: 35

AWS Java SDK credentials linux ec2

I've created my java web application on a tomcat server which will start another instance using the AWS Java SDK, on windows i just place the credentials in my user. Im now trying to host my application on an AWS EC2 Instance and hence i am trying to place my credentials on the Linux EC2 i've follow some steps on the AWS SDK - http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-setup.html as per the link but im still thrown the same error upon calling the method -

Cannot load the credentials from the credential profiles file. Please make sure that your credentials file is at the correct location (~/.aws/credentials), and is in valid format.

I've created a .aws folder in my home directory an placed the credential file within it, i've also added the export codes within the .bashrc file but it doesnt seem to work.

At Wits end here :(

Upvotes: 0

Views: 673

Answers (1)

Mishal Shah
Mishal Shah

Reputation: 41

Check what user tomcat runs as on the other machine.

When you store the credential for your user, they are stored at ~/.aws/credentials.

That's ok for you, but Tomcat may not be running as you.

So ensure a copy is present also at /home/{whateveryourtomcatuseris}/.aws/credentials.

Upvotes: 0

Related Questions