- Newest
- Most votes
- Most comments
Hi,
If you want to add multiple tags to an object in S3, you can do that. This documentation shows you how to do: https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging-managing.html
To create multiple tags when performing a put operations on S3 bucket, you can use put-object. https://awscli.amazonaws.com/v2/documentation/api/2.0.34/reference/s3api/put-object.html
aws s3api put-object --bucket my-example-bucket --key example.txt --body example.txt --tagging "Environment=Production&Department=IT&Project=Migration"
You can also use other ways like Console, SDKs to add multiple tags to an Object when uploading it: https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html#:~:text=To%20upload%20folders%20and%20files,Choose%20Upload.
Hi,
Yes, you can put multiple tags. As you can see from the Python API: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/put_object_tagging.html
As you can see below: TagSet in Tagging below is a list of pair tags: you can put the number you want.
response = client.put_object_tagging(
Bucket='string',
Key='string',
VersionId='string',
ContentMD5='string',
ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256',
Tagging={
'TagSet': [
{
'Key': 'string',
'Value': 'string'
},
]
},
ExpectedBucketOwner='string',
RequestPayer='requester'
)
Best,
Didier
Relevant content
- asked 18 days ago