How to programmatically update CodeDeploy on-premise instance tags?

0

I want to programmatically update the tag on my on-premise instance so that I control whether or not it will be a target for the next deployment e.g. Key=deploy_next,Value=true
However, when using the aws cli my only options for updating the tags seem to be add-tags-to-on-premises-instances and remove-tags-from-on-premises-instances.
add-tags-to-on-premises-instances succeeds when creating the tag for the first time, but trying to use it to update the value returns an error: Duplicate tag for host *** keys [deploy_next]
I would have been okay with using remove-tags-from-on-premises-instances to first delete the tag and then re-create it from scratch, but in order to remove the tag I must also know what the value is currently set to, or else it does not delete the tag.
I also tried the tag-resource command but it returned an error saying it does not support on-premise instance arns.

How can I use the aws cli to update a tag on an on-premise instance without knowing what the value is set to?

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions