From 0783c172d781acc0ce38fe1afa662ea126dabd90 Mon Sep 17 00:00:00 2001 From: "Ryan S. Brown" Date: Mon, 15 Aug 2016 14:27:48 -0400 Subject: [PATCH] Paginate DB cluster responses in AWS RDS dynamic inventory --- contrib/inventory/ec2.ini | 2 +- contrib/inventory/ec2.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/inventory/ec2.ini b/contrib/inventory/ec2.ini index 984251cb2d2..9ae2ecea444 100644 --- a/contrib/inventory/ec2.ini +++ b/contrib/inventory/ec2.ini @@ -83,7 +83,7 @@ all_instances = False all_rds_instances = False # Include RDS cluster information (Aurora etc.) -include_rds_clusters = True +include_rds_clusters = False # By default, only ElastiCache clusters and nodes in the 'available' state # are returned. Set 'all_elasticache_clusters' and/or 'all_elastic_nodes' diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index a870b8fcfed..77e8128d035 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -597,7 +597,13 @@ class Ec2Inventory(object): "getting RDS clusters") client = ec2_utils.boto3_inventory_conn('client', 'rds', region, **self.credentials) - clusters = client.describe_db_clusters()["DBClusters"] + + marker, clusters = '', [] + while marker is not None: + resp = client.describe_db_clusters(Marker=marker) + clusters.extend(resp["DBClusters"]) + marker = resp.get('Marker', None) + account_id = boto.connect_iam().get_user().arn.split(':')[4] c_dict = {} for c in clusters: