Last active
August 14, 2025 00:07
-
-
Save AstroTom/5dc863a0203eca760868f7909de7e306 to your computer and use it in GitHub Desktop.
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
| ## | |
| ## some useful RDS CLI | |
| ## | |
| # RDS events | |
| # Returns events related to DB instances, DB clusters, DB parameter groups, DB security groups, | |
| # DB snapshots, DB cluster snapshots, and RDS Proxies for the past 14 days | |
| # e.g. See changes to Parameter groups | |
| aws rds describe-events --source-identifier your_parameter_group_name --source-type db-parameter-group | |
| # RDS events (same as console) | |
| aws rds describe-events --source-identifier your_db_instance_name --source-type db-instance | |
| export AWS_DEFAULT_REGION=us-east-1 | |
| INSTANCE_ID=your_db_instance_name | |
| DATE=$(date +%Y-%m-%dT%H:%M:%S --date='- 14 day ago') | |
| DATE=$(date +%Y-%m-%dT%H:%M:%S --date='- 13 day - 16 hour ago') | |
| aws rds describe-db-instances --db-instance-identifier ${INSTANCE_ID} | |
| aws rds describe-events --source-type db-instance --source-identifier ${INSTANCE_ID} --start-time ${DATE} | |
| DB_INSTANCE=DB_NAME | |
| # get list of DB logs | |
| aws rds describe-db-log-files --db-instance-identifier $DB_INSTANCE | |
| # download 1 log file | |
| aws rds download-db-log-file-portion --db-instance-identifier $DB_INSTANCE \ | |
| --log-file-name error/postgresql.log.2025-08-12-17 \ | |
| --starting-token 0 \ | |
| --output text > log.2025-08-12-17.txt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment