I'm trying to configure the AWS s3 filesystem on my Sonata-Project, but I always get the following error:
The configured bucket "my-bucket" does not exist.
My sonata_media.yml
:
cdn:
server:
path: http://%s3_bucket_name%.s3-website-%s3_region%.amazonaws.com
providers:
image:
filesystem: sonata.media.filesystem.s3
file:
resizer: false
allowed_extensions: ['pdf']
allowed_mime_types: ['application/pdf', 'application/x-pdf']
filesystem:
s3:
bucket: %s3_bucket_name%
accessKey: %s3_access_key%
secretKey: %s3_secret_key%
region: %s3_region%
I added the following parameters to my parameters.yml:
s3_bucket_name: my-bucket
s3_region: eu-central-1
s3_access_key: MY_ACCESS_KEY
s3_secret_key: MY_SECRET_KEY
At the moment I use this library:
"aws/aws-sdk-php": "2.8.10"
(With the latest versions I got an error with the s3_region parameter.)
Bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket/*"
}
]
}
I think I don't have to say the bucket IS there.
Does anyone have an idea, what the problem is?