Reputation: 323
I am moving files from EC2 instances to AWS S3. I want to to disable the "delete" option in the AWS S3 (when an object is selected), so that the files which are copied to AWS S3 are safe and are not deleted by mistake. I want to preserve the files for at least 6 months.
Upvotes: 8
Views: 10848
Reputation: 11
This is quite a late entry but it might help someone in future. Another option can be to use S3 object lock but the downside is it only works with versioning enabled and to enable version lock on already created buckets you have to reach out to AWS technical support. This effectively applies WORM policy on every object in the whole bucket and prevent anyone to make modification including the owner. The policy period can be set up later after the creation of the bucket. S3 object lock
Upvotes: 0
Reputation: 1392
It's not possible to hide that button.
But you have 2 options to block delete of objects at bucket:
or (better in my opinion):
For example, bucket policy can look like this:
{
"Version": "2012-10-17",
"Id": "<...>",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:DeleteObject",
"Resource": "arn:aws:s3:::<YOUR BUCKET NAME>/*"
},
<...>
]
}
I checked that, if I selected object and clicked Delete button it look like this:
Upvotes: 20