Reputation: 49
I know how to tag single s3 object from my java app. But how can i tag multiple objects at once, if i pass multiple keys ?
We are talking about a big chunk of keys. ~200k
List<Tag> newTags = new ArrayList<Tag>();
newTags.add(new Tag("Tag for delete", "This object should be deleted"));
amazonS3Client.setObjectTagging(new SetObjectTaggingRequest(bucketName, key, new ObjectTagging(newTags)));
I am using the above code for single object tagging.
Upvotes: 0
Views: 3275
Reputation: 61
Yes, there is an option for batch tagging s3 objects in AWS.
Since you are asking for a way to do this, I recommend the s3 batch operations feature: https://aws.amazon.com/blogs/aws/new-amazon-s3-batch-operations/
You can create a manifest of s3 keys and provide the desired tags in the create job request, and it will tag all of the keys in the manifest with those tags.
Upvotes: 1