Is there any common API/SDK to add custom tags to the existing AWS resources?

Viewed 67

I'm trying to implement an API that can add tags to all the existing resources in AWS. I can't use AWS CloudFormation approach for this.

Is there any common API/SDK approach to add custom tags to the existing AWS resources by passing the resourceIds?

2 Answers

What AWS resources do you mean. Do you mean an object in an Amazon S3 bucket? Many Service SDKs expose a Service client that lets you perform tagging operations. Consider the S3Client service client, which is part of the AWS SDK for Java V2.

This service client has a method named putObjectTagging that lets you tag objects. Likewise other service clients have similar tagging methods.

I didn't get any common API/SDK to add tags to different AWS resources. But Here is what I got it and used for my requirement.

Search for Resource Groups & Tag Editor in the AWS Console and go to Tag Editor section, you can see an UI to select resource types and option to add new tags for a region. You can select multiple resources based on the region and resource type you choose and apply the set of tags together in a single shot.

Related