Object tagging
S3 allows you to add tags to your objects. Tagging an object helps in categorizing the objects. Each tag is a key and value pair.
Example of tags on an object: Let's consider a scenario wherein an application processes data stored in an S3 bucket. While traversing through the objects in a bucket, it checks for a tag before processing the data in the object. In such scenarios, you may add the following tag to the objects:
Processed=True
Or:
Processed=False
The application may check for the tag in an object before processing the data in it. If the tag indicates Processed=False
then the application should process the data stored in the object and change the tag to Processed=True
.
You can add tags to an object from object properties in the S3 console. You can also add tags to an object using the AWS CLI as follows:
AWS CLI syntax for adding tags to an object:
aws s3api put-bucket-tagging --bucket <Bucket> --tagging 'TagSet=[{Key=<key>,Value=<value>}]'
Example:
aws s3api...