I have an S3 Bucket that I am attempting to automate uploads to. When I run the playbook, I am getting the following error:
FAILED! => {"boto3_version": "1.22.0", "botocore_version": "1.25.0", "changed": false,
"error": {"code": "AccessControlListNotSupported", "message": "The bucket does not allow
ACLs"}, "msg": "Unable to set object ACL: An error occurred
AWS recommends disabling ACLs, and I am able to use the aws cli just fine with:
aws s3 cp <file name> s3://mybucket/<file name>
My playbook:
- name: Upload logical backup to s3
aws_s3:
bucket: "{{ AWS_S3_BACKUP_BUCKET }}"
aws_access_key: "{{ AWS_S3_BACKUP_ACCESS_KEY_ID }}"
aws_secret_key: "{{ AWS_S3_BACKUP_SECRET_KEY }}"
mode: put
object: logical_db_backups/dump_01.sql.zst
src: /path/to/my/backup/file
If I enable ACLs, the playbook works. However, I would really prefer to use the one user that is given permissions to access the bucket.
I read the Ansible documentation on the aws_s3 module, and it mentioned nothing about ACLs.
Does anyone know of a way to use this module without ACLs? If not, I'm just going back to regular bash and cron jobs.
Version of ansible:
ansible 2.9.6
