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.
To prevent or mitigate future accidental deletions, consider the following features: Enable versioning to keep historical versions of an object. Enable Cross-Region Replication of objects. Enable MFA delete to require multi-factor authentication (MFA) when deleting an object version.
Storage class for automatically optimizing data with changing or unknown access patterns. S3 Intelligent-Tiering is an Amazon S3 storage class designed to optimize storage costs by automatically moving data to the most cost-effective access tier, without performance impact or operational overhead.
You can set up a lifecycle rule to automatically delete objects such as log files. For more information, see Setting lifecycle configuration on a bucket.
Description. Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn't a null version, Amazon S3 does not remove any objects. To remove a specific version, you must be the bucket owner and you must use the version Id subresource.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With