- outline
Deletion protection value is very useful and important for AWS Service. It can prevent unexpected deletion of AWS resources. Below script is for checking deletion protection of ELB. If you change list part of below script, you can another AWS resource.
- script (elb_attr_delete_protection.sh)
#!/bin/bash
echo "ELB attributes"
for i in $(aws elbv2 describe-load-balancers --query LoadBalancers[].LoadBalancerArn[] --output text)
do
echo $i
aws elbv2 describe-load-balancer-attributes --load-balancer-arn $i --query 'Attributes[?Key==`deletion_protection.enabled`].Value[]' 2>/dev/null
done
echo "======================================================================================================================="