1

How can I retrieve information using the AWS CLI about the active elastic beanstalk instance setup in a blue/green manner (where two environments are running side by side).

Running the following command gives me an array of environments for my application:

aws elasticbeanstalk describe-environments --application-name MyApp

Although I would prefer a command which only returned the active environment (and not the inactive).

Is the most accurate way to tell this by CNAME containing the string inactive from the command output?

The specific piece of data which I require is EnvironmentName.

4

1 回答 1

2

您需要几个 aws cli 才能找到它。

获取托管区域 ID

aws route53 list-hosted-zones

过滤掉目标区域id

列出弹性 beantalk 应用程序

aws elasticbeanstalk describe-environments --application-name MyApp | jq -r '.Environments[].CNAME'

导出其 CNAME

获取该区域 ID 中的记录集。

aws route53 list-resource-record-sets --hosted-zone-id <hosted-zone-id>

过滤掉从上面elasticbeanstalkcli获得的 CNAME

于 2017-06-11T23:21:06.143 回答