- Newest
- Most votes
- Most comments
Hello.
If you want to change the tags of an EC2 instance, how about using the AWS CLI's "create-tags" command?
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-tags.html
I think you can edit the tag if you can execute the following command within EC2.
aws ec2 create-tags --resources i-xxxxxxx --tags Key=app_version,Value=xxxx
By the way, in order to overwrite or create tags for EC2 instances, the action "ec2:CreateTags" must be allowed by the IAM role.
https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonec2.html
How about using Systems Manager Automation to run the script on the nodes and add a step to update the tags?
That is one of the options that I looked at. However, Systems Manager Automation is not a simple beast, and I quickly looked for another solution. Automations, Runbooks, Documents, etc... All sounds good for AMI, but nothing is simple for edge devices.
I'll give it another look though.
Unfortunately, our permissions will not allow the 'add-tags-to-resource', as allowing it opens up potential security risks. It can be called from any resource without restriction.
Relevant content
- asked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 3 months ago

Thank you, however, I am not using EC2. These are edge devices and aws ssm does not have a create-tags command.
If so, why not try using the "add-tags-to-resource" command? https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/add-tags-to-resource.html