terraform.aws-baseline-infra/modules/util/resource-list/list-nlb-targetgroups.sh

7 lines
271 B
Bash
Executable File

#!/bin/bash
eval "$(jq -r '@sh "lb=\(.input)"')"
RESULTS=$(aws elbv2 describe-target-groups --load-balancer-arn $lb --query TargetGroups[*].TargetGroupArn --output text --no-cli-pager | sed 's/\t/\n/g' | sort | xargs)
jq -n --arg result "$RESULTS" '{"result":$result}'