From 65c4b7dd3e9a4b6dbda0589f08804552a320080e Mon Sep 17 00:00:00 2001 From: Daiki Arai Date: Sat, 23 Nov 2024 03:01:06 +0900 Subject: [PATCH] Get taskSubnetId by checking attachements widely --- check-ecs-exec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-ecs-exec.sh b/check-ecs-exec.sh index 2a692a7..b7d3738 100755 --- a/check-ecs-exec.sh +++ b/check-ecs-exec.sh @@ -635,7 +635,7 @@ if [[ "${taskNetworkingAttachment}" = "null" ]]; then subnetJson=$(${AWS_CLI_BIN} ec2 describe-subnets --subnet-ids "${taskSubnetId}") else ## awsvpc networking (for both EC2 and Fargate) - taskSubnetId=$(echo "${describedTaskJson}" | jq -r ".tasks[0].attachments[0].details[] | select(.name==\"subnetId\") | .value") + taskSubnetId=$(echo "${describedTaskJson}" | jq -r ".tasks[0].attachments[].details[] | select(.name==\"subnetId\") | .value") subnetJson=$(${AWS_CLI_BIN} ec2 describe-subnets --subnet-ids "${taskSubnetId}") taskVpcId=$(echo "${subnetJson}" | jq -r ".Subnets[0].VpcId") fi