Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Created July 14, 2020 00:47
Show Gist options
  • Save rms1000watt/2f26ef3979d8796608e2ea718de9a544 to your computer and use it in GitHub Desktop.
Save rms1000watt/2f26ef3979d8796608e2ea718de9a544 to your computer and use it in GitHub Desktop.
Disable Deletion Protection on ALBs
#!/usr/bin/env bash
for arn in $(aws elbv2 describe-load-balancers | jq -r '.LoadBalancers[] | select(.DNSName | contains("TODO_CHANGE_THIS")) | .LoadBalancerArn'); do
echo "Updating: ${arn}"
aws elbv2 modify-load-balancer-attributes --load-balancer-arn "${arn}" --attributes Key=deletion_protection.enabled,Value=false
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment