Guest User

Untitled

a guest
Dec 14th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. WINDOW=Tue:15:00-Tue:15:30
  4.  
  5. set_window ()
  6. {
  7. local db_id=$1
  8. aws rds modify-db-instance \
  9. --db-instance-identifier $db_id \
  10. --preferred-maintenance-window $WINDOW
  11. }
  12.  
  13. get_rds_db_ids ()
  14. {
  15. aws rds describe-db-instances \
  16. | jq -r '.DBInstances[].DBInstanceIdentifier'
  17. }
  18.  
  19. for this_db_id in $(get_rds_db_ids)
  20. do
  21. set_window $this_db_id
  22. done
Add Comment
Please, Sign In to add comment