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?

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen