Hi Guys,I try to get data from S3 AWS bucket. I set up bucket like public with bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "*",
"Resource": "arn:aws:s3:::transformed-for-visualization-data-1/*"
}
]
}
In python script :
import boto3
from botocore import UNSIGNED
from botocore.client import Config
client = boto3.client('s3', config=Config(signature_version=UNSIGNED))
resource = boto3.client('s3', config=Config(signature_version=UNSIGNED))
for obj in client.list_objects_v2(Bucket='transformed-for-visualization-data-1', Prefix="csv/")['Contents']:
print(obj['Key'])
after run it got an error:
ClientError: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied
Where is mistake ?