Created
November 26, 2015 09:13
-
-
Save ajohnstone/64f4d26d0ef01a7b21b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ELBS="`aws elb describe-load-balancers`"; | |
echo "$ELBS" | jq -c '.LoadBalancerDescriptions[] | select(.LoadBalancerName|contains("production-services"))' | tr -d '^J' | while read line; do | |
NAME=$(echo $line | jq -r '.LoadBalancerName') | |
echo $NAME | grep tmp$ && continue; | |
LISTENERS=$(echo $line | jq -c '.ListenerDescriptions[].Listener'| tr -d '^J' | tr '\n' ',' | sed 's/^/\[/g;s/,$/]/g'); | |
SCHEME=$(echo $line | jq -r '.Scheme') | |
aws elb create-load-balancer --load-balancer-name "${NAME}tmp" --listeners "${LISTENERS}" --scheme "${SCHEME}" --security-groups sg-3c7df658 --subnets subnet-f598ee9d | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment