Now, we can add tags to each object.
Using AWS S3API,
aws s3api put-object-tagging --bucket bucket_name --key key_name --tagging 'TagSet=[{Key=type,Value=text1}]'
We can also add tags to objects using python API. Following code snippet add tags to all objects in bucket. You can pass object name if you want to add tag to just one object.
session = aws_session.set_aws_session()
s3 = boto3.Session(aws_access_key_id, aws_secret_access_key)
bucketName = 'bucketName'
bucket = s3.Bucket(bucketName)
object_list = bucket.objects.all()
s3 = session.client('s3')
tagging = {'TagSet' : [{'Key': 'CONF', 'Value':'No'}]}
for obj in object_list:
s3.put_object_tagging(
Bucket = bucketName,
Key = obj.key,
Tagging = tagging
)