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

前端 未结 9 2024
借酒劲吻你
借酒劲吻你 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:26

    AFAIK directly through the CLI you won't be able to do that.

    By the syntax you are using, I can guess you are using the old cli. I suggest you to download the new CLI http://aws.amazon.com/cli/ and call

    aws ec2 describe-instances --output json

    from python, ruby or any scripting language you may like to parse the json output filtering using the proper regular expression according to your needs

提交回复
热议问题