Welcome to the new Amazon S3 User Guide! The Amazon S3 User Guide combines information and instructions from the three retired guides: Amazon S3 Developer Guide, Amazon S3 Console User Guide, and Amazon S3 Getting Started Guide.
Deleting a single object
You can use the Amazon S3 console or the DELETE API to delete a single existing object from an S3 bucket.
Because all objects in your S3 bucket incur storage costs, you should delete objects that you no longer need. For example, if you are collecting log files, it's a good idea to delete them when they're no longer needed. 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.
For information about Amazon S3 features and pricing, see Amazon S3 pricing
Follow these steps to use the Amazon S3 console to delete a single object from a bucket.
To delete an object
-
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
In the Bucket name list, choose the name of the bucket that you want to delete an object from.
-
Choose the name of the object that you want to delete.
-
To delete the current version of the object, choose Latest version, and choose the trash can icon.
-
To delete a previous version of the object, choose Latest version, and choose the trash can icon beside the version that you want to delete.
The following examples show how you can use the AWS SDKs to delete an object from a bucket. For more information, see DELETE Object in the Amazon Simple Storage Service API Reference
If you have S3 Versioning enabled on the bucket, you have the following options:
-
Delete a specific object version by specifying a version ID.
-
Delete an object without specifying a version ID, in which case Amazon S3 adds a delete marker to the object.
For more information about S3 Versioning, see Using versioning in S3 buckets.
To delete one object per request, use the DELETE
API. For more
information, see DELETE
Object. For more information about using the CLI to delete an object,
see delete-object
You can use the AWS SDKs to delete an object. However, if your application requires it, you can send REST requests directly. For more information, see DELETE Object in the Amazon Simple Storage Service API Reference.