Skip to content

Instantly share code, notes, and snippets.

@johnder
Last active April 10, 2022 15:49
Show Gist options
  • Save johnder/1861afaacfd9599cb78b23435320203a to your computer and use it in GitHub Desktop.
Save johnder/1861afaacfd9599cb78b23435320203a to your computer and use it in GitHub Desktop.
get alb tls policies
#!/bin/bash
export AWS_PAGER="". #this is needed to prevent pagenation of the output so its one continuous list
# function to lList application load balancers by ARN
load_balancer_arns=$(aws elbv2 describe-load-balancers \
--query 'sort_by(LoadBalancers[?contains(LoadBalancerArn,`:loadbalancer/app/`)],&LoadBalancerArn)[].[LoadBalancerArn]' \
--output text)
# For each ALB show listeners with ther attachged ssl policy name SSL policy
for arn in $load_balancer_arns
do
aws elbv2 describe-listeners \
--load-balancer-arn "$arn" \
--query 'Listeners[?SslPolicy!=`null`].{LoadBalancerArn:ListenerArn,SslPolicy:SslPolicy}' \
--output text
done
#exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment