File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 616616# TODO: In the ideal world, the script should simply check if the task can reach to the internet or not :)
617617requiredEndpoint=" com.amazonaws.${AWS_REGION} .ssmmessages"
618618taskNetworkingAttachment=$( echo " ${describedTaskJson} " | jq -r " .tasks[0].attachments[0]" )
619- taskSubnetId=$( echo " ${describedTaskJson} " | jq -r " .tasks[0].attachments[0].details[] | select(.name==\" subnetId\" ) | .value" )
620- subnetJson=$( ${AWS_CLI_BIN} ec2 describe-subnets --subnet-ids " ${taskSubnetId} " )
621619if [[ " x${taskNetworkingAttachment} " = " xnull" ]]; then
622620 # # bridge/host networking (only for EC2)
623621 taskVpcId=$( echo " ${describedContainerInstanceJson} " | jq -r " .containerInstances[0].attributes[] | select(.name==\" ecs.vpc-id\" ) | .value" )
622+ taskSubnetId=$( echo " ${describedContainerInstanceJson} " | jq -r " .containerInstances[0].attributes[] | select(.name==\" ecs.subnet-id\" ) | .value" )
623+ subnetJson=$( ${AWS_CLI_BIN} ec2 describe-subnets --subnet-ids " ${taskSubnetId} " )
624624else
625625 # # awsvpc networking (for both EC2 and Fargate)
626+ taskSubnetId=$( echo " ${describedTaskJson} " | jq -r " .tasks[0].attachments[0].details[] | select(.name==\" subnetId\" ) | .value" )
627+ subnetJson=$( ${AWS_CLI_BIN} ec2 describe-subnets --subnet-ids " ${taskSubnetId} " )
626628 taskVpcId=$( echo " ${subnetJson} " | jq -r " .Subnets[0].VpcId" )
627629fi
628630# # Obtain the ownerID of subnet's owner to check if the subnet is shared via AWS RAM (which check-ecs-exec.sh doesn't support today)
You can’t perform that action at this time.
0 commit comments