Skip to content

Instantly share code, notes, and snippets.

@tomislacker
Created December 12, 2017 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomislacker/353628404faa79e253563f59c43092e2 to your computer and use it in GitHub Desktop.
Save tomislacker/353628404faa79e253563f59c43092e2 to your computer and use it in GitHub Desktop.
RDS Set All Maintenance Windows
#!/bin/bash
WINDOW=Tue:15:00-Tue:15:30
set_window ()
{
local db_id=$1
aws rds modify-db-instance \
--db-instance-identifier $db_id \
--preferred-maintenance-window $WINDOW
}
get_rds_db_ids ()
{
aws rds describe-db-instances \
| jq -r '.DBInstances[].DBInstanceIdentifier'
}
for this_db_id in $(get_rds_db_ids)
do
set_window $this_db_id
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment