Skip to content

Instantly share code, notes, and snippets.

@shootacean
Last active June 18, 2021 22:31
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 shootacean/52e9c779402ba676c082634a5b569026 to your computer and use it in GitHub Desktop.
Save shootacean/52e9c779402ba676c082634a5b569026 to your computer and use it in GitHub Desktop.
Amazon RDSのバックアップ設定を一覧で取得するPythonスクリプト
import sys
import time
import boto3
AWS_REGION = 'ap-northeast-1'
AWS_PROFILE = 'your-profile'
if __name__ == "__main__":
session = boto3.Session(profile_name=AWS_PROFILE, region_name=AWS_REGION)
client = session.client('rds')
response = client.describe_db_clusters()
for cluster in response['DBClusters']:
print(
cluster['DBClusterIdentifier'],
cluster['BackupRetentionPeriod'],
cluster['PreferredBackupWindow'],
cluster['PreferredMaintenanceWindow'],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment