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 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容