I'm using aws-cli/1.15.25 Python/2.7.15 Darwin/17.7.0 botocore/1.10.25 to try and upload a file to S3 using the following command:
aws s3 cp <file> s3://bucket.s3.amazonaws.com/<bucket name>
But I get the following returned:
u
pload failed: ./<file> to s3://bucket.s3.amazonaws.com/<bucket name> An error occurred (AllAccessDisabled) when calling the PutObject operation: All access to this object has been disabled
I have, as a test, set my bucket to accessible by all with the following policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Principal": "*",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:PutObjectAcl",
"s3:GetObjectAcl"
],
"Resource": [
"arn:aws:s3:::<bucket name>/*"
]
}
]
}
My IAM user has the correct permissions set
I don't know what else to look at. I've Googled and tried most suggestions
Short description. The "403 Access Denied" error can occur due to the following reasons: Your AWS Identity and Access Management (IAM) user or role doesn't have permissions for both s3:GetBucketPolicy and s3:PutBucketPolicy.
If you're getting Access Denied errors on public read requests that are allowed, check the bucket's Amazon S3 Block Public Access settings. Review the S3 Block Public Access settings at both the account and bucket level. These settings can override permissions that allow public read access.
To run the command aws s3 sync, then you need permission to s3:GetObject, s3:PutObject, and s3:ListBucket. Note: If you're using the AssumeRole API operation to access Amazon S3, you must also verify that the trust relationship is configured correctly.
Note: AllAccessDisabled error will be displayed when non existing folder path is specified (misspelling) .
You are specifying the bucket name twice in the URL or you are actually using the string "bucket".
Your can use the virtual hosted style as:
http://bucketname.s3.amazonaws.com/path/to/file
http://bucketname.s3-aws-region.amazonaws.com/path/to/file
or the path style URL:
http://s3.amazonaws.com/bucketnamepath/to/file
http://s3-aws-region.amazonaws.com/bucketname/path/to/file
Replace "aws-region" with the region. Use the "s3-aws-region" style for regions that are not us-east-1. Examples for a bucket in South America:
http://bucketname.s3-sa-east-1.amazonaws.com/path/to/file
http://s3-sa-east-1.amazonaws.com/bucketname/path/to/file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With