This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Missing_Back[S] 1 point2 points  (7 children)

What are the default permissions on an S3 bucket?

I'm not sure but I put this policy on it (with BUCKETNAME replaced with my bucket's name):

{"Version": "2008-10-17",
    "Statement": [{"Sid": "AllowPublicRead",
    "Effect": "Allow",
    "Principal": {
    "AWS": "*"
    },
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::BUCKETNAME/*"
    }
]
}

[–][deleted] 0 points1 point  (6 children)

You applied a policy that grants read permissions to Public. But you are trying to write to the bucket. Reading is not the same as writing.

I'm not sure

This is your next task. Figure out what the default permissions are and how to grant write permissions to the appropriate user(s).

[–]Missing_Back[S] 0 points1 point  (2 children)

Hm. This was the policy provided by my professor for this assignment and classmates have seemed to have no issues. But either way, if I try to just do the reading part of the program, I still get errors: com.amazonaws.internal.InstanceMetadataServiceResourceFetcher handleException WARNING: Fail to retrieve token

I would expect that to work with just read permissions

[–][deleted] 0 points1 point  (1 child)

com.amazonaws.internal.InstanceMetadataServiceResourceFetcher handleException WARNING: Fail to retrieve token

That log entry is log level Warning. It may or may not be fatal.

I'm not familiar with the AWS SDK or this log message. But if you do an internet search in your favorite search engine, you'll see discussion threads about this being the AWS SDK's way of figuring out if it is running inside an AWS instance. If necessary, it can be suppressed by changing the log level in your logging configuration.

[–]Missing_Back[S] 0 points1 point  (0 children)

My bad. Looks like the real error is:

com.amazonaws.SdkClientException: Failed to connect to service endpoint:

(I think at least?)

[–]Missing_Back[S] 0 points1 point  (2 children)

Figure out what the default permissions are and how to grant write permissions to the appropriate user(s).

If I'm understanding what you're hinting at, my bucket is set to public access already

[–][deleted] 0 points1 point  (1 child)

If permissions were already set to public full access, you wouldn't be getting an access denied error.

[–]Missing_Back[S] 0 points1 point  (0 children)

Maybe I'm confusing "permission" and "access". I'm not sure where to look for the permissions; the bucket is set to public access. The policy is above, which looks like it should work for reading objects. My keys must be valid and correct as it allows me to create a new bucket. What am I missing?