Last active
April 10, 2022 15:49
-
-
Save johnder/1861afaacfd9599cb78b23435320203a to your computer and use it in GitHub Desktop.
get alb tls policies
This file contains 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
#!/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