Last active
November 29, 2022 13:40
-
-
Save heronrs/30b745092792a19c98fa1d9718f2d192 to your computer and use it in GitHub Desktop.
Diagnoses potential rack applications that might have been affected by the Cloudformation RDS problem
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
| #!/bin/bash | |
| # Run this script in a terminal with your AWS credentials and region configured. | |
| # The script will output potential apps that might have been affected by the RDS problem. | |
| echo "Running diagnose..." | |
| aws cloudformation describe-stacks --query 'Stacks[*].StackName' --no-paginate |jq -c '.[]'| while read i; do | |
| if [[ $i =~ .*-Resource.*-.* ]]; then | |
| encrypted=$(aws cloudformation describe-stacks --stack-name $(echo $i|tr -d '"') --query 'Stacks[0].Parameters[?ParameterKey==`Encrypted`]'.ParameterValue --output text) | |
| if [ -z "$encrypted" ]; then | |
| IFS='-' | |
| read -a strarr <<< $i | |
| echo "message=resource might be affected rack=$(echo ${strarr[0]}|tr -d '"') app=${strarr[1]} resource=${strarr[2]}" | |
| IFS= | |
| fi | |
| fi | |
| done | |
| echo "Follow the steps in https://t.ly/CMx1 to fix the problem" | |
| echo "Diagnose complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment