Created
December 12, 2017 15:54
-
-
Save tomislacker/353628404faa79e253563f59c43092e2 to your computer and use it in GitHub Desktop.
RDS Set All Maintenance Windows
This file contains 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 | |
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