aws-samples / aws-java-sample

Sample project to demonstrate usage of the AWS SDK for Java
Apache License 2.0
231 stars 339 forks source link

Caught an AmazonServiceException #11

Open SonnyRajagopalan opened 8 years ago

SonnyRajagopalan commented 8 years ago

When I tried to run this sample, I get this:

Error Message:    Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: <>)
HTTP Status Code: 403
AWS Error Code:   AccessDenied
Error Type:       Client
Request ID:       <>

Any help is appreciated.

fulghum commented 8 years ago

Looks like an authentication problem. Are you sure your AWS credentials are specified correctly and that your credentials are configured for S3 access?

SonnyRajagopalan commented 8 years ago

I got my credentials from https://console.aws.amazon.com/iam/home?#users I am not sure how to configure for S3 access. This is not mentioned in the README.

PS: Thanks for the mighty quick response!

On Tue, Nov 24, 2015 at 3:20 PM, Jason Fulghum notifications@github.com wrote:

Looks like an authentication problem. Are you sure your AWS credentials are specified correctly and that your credentials are configured for S3 access?

— Reply to this email directly or view it on GitHub https://github.com/awslabs/aws-java-sample/issues/11#issuecomment-159394222 .

SonnyRajagopalan commented 8 years ago

Never mind. I figured this out. In https://console.aws.amazon.com/iam/home?#policies, filter by the string "S3." Check on "AmazonS3FullAccess." On the top, click on "Policy Actions" and then "Attach" and the user you want to assign this policy to. Now, I am able to run the example.

SonnyRajagopalan commented 8 years ago

PS: it is worthwhile updating the README for this. Let me know if you will let me open a pull request; else, please close this issue.

fulghum commented 8 years ago

Glad you got it figured out so fast! We'd be happy to accept a pull request for updated documentation.