【发布时间】:2020-10-28 04:11:55
【问题描述】:
我想用以下标签/值获取所有 CloudFormation 堆栈的堆栈名称:
elasticbeanstalk:environment-name : myenvironment
有没有办法做到这一点?我试过这个查询,但它抛出了一个语法错误:
aws cloudformation describe-stacks --query 'Stacks[].Tags[?Key == `elasticbeanstalk:environment-name` && ?Value == `myenvironment`]'
编辑
我想出了过滤部分,但我不知道如何获取堆栈名称。这返回 null,我如何检索 StackName?
aws cloudformation describe-stacks --query 'Stacks[].Tags[?Key == `elasticbeanstalk:environment-name` && Value == `myenv`].{MyStack: StackName}'
【问题讨论】:
标签: amazon-web-services amazon-cloudformation aws-cli jmespath