I am new to aws.. I uploaded a image in the bucket
if i try to open the object url in browser im getting the following error.
below are the bucket policies i have configured my bucket with
{
"Version": "2012-10-17",
"Id": "Policy1566555268319",
"Statement": [
{
"Sid": "Stmt1566555264845",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::497899159094:user/DevUser"
},
"Action": [
"s3:PutObject",
"s3:PutObjectAcl"
],
"Resource": "arn:aws:s3:::akirainfocombucket/*",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "public-read"
}
}
}
]
}
and Below are the CORS Configurations
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
The Block all public access is set to Off as suggested by the support team.
I want the object link to be accessible in the browser..(Read only)
need help to configure the Bucket ?
If you're trying to host a static website using Amazon S3, but you're getting an Access Denied error, check the following requirements: Objects in the bucket must be publicly accessible. S3 bucket policy must allow access to the s3:GetObject action. The AWS account that owns the bucket must also own the object.
Sign in to Amazon Web Services and go to your S3 Management Console. 2. Click on the name of the S3 bucket from the list. If it's still in its default access state, it should say “Buckets and objects not public” next to it.
I doubted this might need permission to get the object so that you can view the image from the URL in S3.
I configured the bucket policy like given below.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:PutObject",
"s3:PutObjectAcl",
"s3:GetObject"
],
"Resource": "arn:aws:s3:::delxpro.com/*"
}
]
}
In the above code, look for this piece of line "s3:GetObject". Add this line in your action attribute and check will it work or not.
It will retrieves object from S3, so that you can view your image from the URL.
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