Finding all Amazon AWS Instances That Do Not Have a Certain Tag

前端 未结 9 2023
借酒劲吻你
借酒劲吻你 2020-12-23 12:09

I\'m trying to use the Amazon AWS Command Line Tools to find all instances that do not have a specified tag.

Finding all instances WITH a tag is simple enough, e.g.<

9条回答
  •  天命终不由人
    2020-12-23 12:36

    I was having the same problem and I figured out how to query on Tag-Values you will most likely have the same tag-key defined for all the instances; I have defined a tag-key "MachineName" on all my instances and I want to filter by the the values of the Tag-key Name

    Below is the example to filter where the Name=Machine1

    use the option

    --filters "Name=tag-key,Values=MachineName" "Name=tag-values,Values=Machine1"
    

    This works fine for me

提交回复
热议问题