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?

profile picture
已提問 7 個月前檢視次數 75 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南