diff --git a/opsworks/__init__.py b/opsworks/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/opsworks/__init__.py @@ -0,0 +1 @@ + diff --git a/rds/__init__.py b/rds/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/rds/__init__.py @@ -0,0 +1 @@ + diff --git a/rds/rds.py b/rds/rds.py new file mode 100644 index 0000000..ee602ec --- /dev/null +++ b/rds/rds.py @@ -0,0 +1,31 @@ +import boto3 +import botocore +import pprint + +pp = pprint.PrettyPrinter(indent=5, width=80) + +#from http://docs.aws.amazon.com/general/latest/gr/rande.html +regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ] + + +def describe_db_instances(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY): + print("doing stuff") + try: + for region in regions: + client = boto3.client( + 'rds', + aws_access_key_id = AWS_ACCESS_KEY_ID, + aws_secret_access_key = AWS_SECRET_ACCESS_KEY, + region_name=region + ) + + instances = client.describe_db_instances() + for r in instances['DBInstances']: + for i in r['Instances']: + pp.pprint(i) + + except botocore.exceptions.ClientError as e: + print e + + +describe_db_instances(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) \ No newline at end of file diff --git a/sts/__init__.py b/sts/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/sts/__init__.py @@ -0,0 +1 @@ +