AWS: Append only mode for S3 bucket

amazon-s3, amazon-web-services

Solution

Yes, it is possible. There are two ways to add permissions to a bucket and its contents: Bucket policies and Bucket ACLs. You can achieve what you want by using bucket policies. On the other hand, Bucket ACLs do not allow you to give "create" permission without giving "delete" permission as well.

1-Bucket Policies: You can create a bucket policy (see some common examples here), allowing, for example, an specific IP address to have specific permissions. For example, you can allow: `s3:PutObject` and not allow `s3:DeleteObject`. More on S3 actions in bucket policies can be found here.

2-Bucket ACLs: Using Bucket ACLs, you can only give the complete "write" permission, i.e. if a given user is able to add a file, he is also able to delete files.

Problem

Context I want to have a machine upload a file dump.rdb to s3/blahblahblah/YEAR-MONTH-DAY-HOUR.rdb on the hour. Thus, I need this machine to have the ability to upload new files to S3. However, I don't want this machine to have the ability to (1) delete existing files or (2) overwrite existing files. In a certain sense, it can only "append" -- it can only add in new objects. Question: Is there a way to configure an S3 setup like this? Thanks!

Original source

Related problems