Skip to content

Instantly share code, notes, and snippets.

@SafeEval
Created August 12, 2024 16:25
Show Gist options
  • Save SafeEval/a8c71af23643e458d745d787b2c504b5 to your computer and use it in GitHub Desktop.
Save SafeEval/a8c71af23643e458d745d787b2c504b5 to your computer and use it in GitHub Desktop.
List `rds.force_ssl` RDS DB Parameter Group values for all DBs in the account. Dump results to CSV.
#!/bin/bash
# List `rds.force_ssl` RDS DB Parameter Group values for all DBs in the account.
# Dump the results to CSV.
OUTFILE="rds-force-ssl.$(date +%s).csv"
# Get all RDS parameter group names
parameter_groups=$(aws rds describe-db-parameter-groups --query "DBParameterGroups[].DBParameterGroupName" --output text)
# Loop through each parameter group and check rds.force_ssl status
for group in $parameter_groups; do
echo "Checking rds.force_ssl for parameter group: $group"
force_ssl=$(aws rds describe-db-parameters --db-parameter-group-name "$group" \
--query "Parameters[?ParameterName=='rds.force_ssl'].{ParameterGroupName:'$group',Value:ParameterValue}" \
--output text | awk '{print $2}')
echo "$group,$force_ssl" >> $OUTFILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment