使用aws cli为每个ecs集群获取ecs服务

问题描述 投票:0回答:1

使用bash脚本,如何获取所有ecs集群的ecs中所有服务的列表。

ecscluster=$(aws ecs list-clusters)

aws ecs list-services --cluster $ecscluster
bash aws-cli
1个回答
0
投票

这可能会实现您所需要的:

all_services="$(for ecscluster in $(
aws ecs list-clusters); do aws ecs list-services --cluster $ecscluster; done)"

echo "$all_services"
© www.soinside.com 2019 - 2024. All rights reserved.