A bucket was created on S3 using the AWS CLI, and the following error was reported when uploading a file:
A Client Error (AccessDenied) occurred when calling the Createmultipartupload operation:anonymous users cannot initiate m Ultipart uploads. Please authenticate.
Execute command: AWS S3 LS S3://mybucket-1 also prompts for permission errors.
Before using the AWS CLI Operation S3 is normal, the only difference is: this time I am using an IAM user, not the root user. However, the IAM user I am using has granted the "amazons3fullaccess" permission, which in theory can be accessed normally by S3.
Try to set policy for buckets:
{ "Version":"2012-10-17", "Statement": [ { "Sid":"", "Effect":" Allow", "Principal":"*", "Action":"S3:listbucket", "Resource":"arn:aws:s3:::mybucket-1" }, { "Sid":"", "Effect":" Allow", "Principal":"*", "Action": [ "S3:deleteobject", "S3:getobject", "S3:putobject" ], "Resource":"arn:aws:s3:::mybucket-1/*" } ]}
Then use the AWS CLI to operate S3, everything works. At this point, the problem is solved.
The next day, accidentally using the AWS CLI to operate another bucket with no policy set, everything works! Then delete the policy on "mybucket-1" and try using the AWS CLI again to operate "mybucket-1", the result is still normal!
After the google,stack overflow a great God gave the answer: when encountering this problem, go out and walk the dog a lap back and then continue to operate it is OK!
Http://stackoverflow.com/questions/33600192/aws-s3-cli-anonymous-users-cannot-initiate-multipart-uploads
Permissions bug for AWS S3 CLI