Last active
June 18, 2021 22:31
-
-
Save shootacean/52e9c779402ba676c082634a5b569026 to your computer and use it in GitHub Desktop.
Amazon RDSのバックアップ設定を一覧で取得するPythonスクリプト
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
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