Skip to content

Commit a8f0d7d

Browse files
authored
Merge pull request #181 from awslabs/feat/db-cluster-inventory-collection
Inventory collection for RDS DB Clusters
2 parents b368fb2 + 250d11f commit a8f0d7d

File tree

3 files changed

+144
-2
lines changed

3 files changed

+144
-2
lines changed

data-collection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ List of modules and objects collected:
2626
| `trusted-advisor` | AWS Trusted Advisor | Linked Account | Requires Enterpriso or OnRamp Support Level |
2727
| `cost-explorer-cost-anomaly` | AWS Anomalies | Management Account | |
2828
| `cost-explorer-rightsizing` | AWS Cost Explorer | Management Account | DEPRECATED. Please use `cost-optimization-hub` |
29-
| `inventory` | Various services | Linked Account | Collects `Amazon OpenSearch Domains`, `Amazon ElastiCache Clusters`, `RDS DB Instances`, `EBS Volumes`, `AMI`, `EC2 Instances`, `EBS Snapshot`, `RDS Snapshot`, `Lambda` |
29+
| `inventory` | Various services | Linked Account | Collects `Amazon OpenSearch Domains`, `Amazon ElastiCache Clusters`, `RDS DB Instances`, `EBS Volumes`, `AMI`, `EC2 Instances`, `EBS Snapshot`, `RDS Snapshot`, `Lambda`, `RDS DB Clusters`, `EKS Clusters` |
3030
| `pricing` | Various services | N/A | Collects pricing for `Amazon RDS`, `Amazon EC2`, `Amazon ElastiCache`, `AWS Lambda`, `Amazon OpenSearch`, `AWS Compute Savings Plan` |
3131
| `rds-usage` | Amazon RDS | Linked Account | Collects CloudWatch metrics for chargeback |
3232
| `transit-gateway` | AWS Transit Gateway | Linked Account | Collects CloudWatch metrics for chargeback |

data-collection/deploy/deploy-in-linked-account.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ Resources:
184184
- "ec2:DescribeRegions"
185185
- "ec2:DescribeInstances"
186186
- "ec2:DescribeVpcs"
187+
- "rds:DescribeDBClusters"
187188
- "rds:DescribeDBInstances"
188189
- "rds:DescribeDBSnapshots"
189190
- "es:ListDomainNames"

data-collection/deploy/module-inventory.yaml

Lines changed: 142 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Parameters:
5656
Description: ARN of a Lambda for Managing GlueTable
5757
AwsObjects:
5858
Type: CommaDelimitedList
59-
Default: OpensearchDomains, ElasticacheClusters, RdsDbInstances, EBS, AMI, Snapshot, Ec2Instances, VpcInstances, RdsDbSnapshots, EKSClusters, LambdaFunctions
59+
Default: OpensearchDomains, ElasticacheClusters, RdsDbInstances, EBS, AMI, Snapshot, Ec2Instances, VpcInstances, RdsDbSnapshots, EKSClusters, LambdaFunctions, RdsDbClusters
6060
Description: Services for pulling price data
6161

6262
Mappings:
@@ -189,6 +189,141 @@ Mappings:
189189
SerializationLibrary: org.openx.data.jsonserde.JsonSerDe
190190
TableType: EXTERNAL_TABLE
191191

192+
RdsDbClusters:
193+
path: rds-db-clusters
194+
table:
195+
- Name: inventory_rds_db_clusters_data
196+
TableType: EXTERNAL_TABLE
197+
198+
PartitionKeys:
199+
- { Name: payer_id, Type: string }
200+
- { Name: year, Type: string }
201+
- { Name: month, Type: string }
202+
- { Name: day, Type: string }
203+
StorageDescriptor:
204+
Columns:
205+
- Name: readreplicaidentifiers
206+
Type: string
207+
- Name: capacity
208+
Type: string
209+
- Name: charactersetname
210+
Type: string
211+
- Name: preferredbackupwindow
212+
Type: string
213+
- Name: copytagstosnapshot
214+
Type: string
215+
- Name: activitystreamkinesisstreamname
216+
Type: string
217+
- Name: multiaz
218+
Type: string
219+
- Name: backtrackwindow
220+
Type: string
221+
- Name: earliestrestorabletime
222+
Type: string
223+
- Name: engine
224+
Type: string
225+
- Name: earliestbacktracktime
226+
Type: string
227+
- Name: httpendpointenabled
228+
Type: string
229+
- Name: percentprogress
230+
Type: string
231+
- Name: dbclusterparametergroup
232+
Type: string
233+
- Name: hostedzoneid
234+
Type: string
235+
- Name: status
236+
Type: string
237+
- Name: associatedroles
238+
Type: string
239+
- Name: dbclusteridentifier
240+
Type: string
241+
- Name: backtrackconsumedchangerecords
242+
Type: string
243+
- Name: iamdatabaseauthenticationenabled
244+
Type: string
245+
- Name: serverlessv2scalingconfiguration
246+
Type: string
247+
- Name: customendpoints
248+
Type: string
249+
- Name: port
250+
Type: string
251+
- Name: activitystreamkmskeyid
252+
Type: string
253+
- Name: masterusername
254+
Type: string
255+
- Name: dbclusterresourceid
256+
Type: string
257+
- Name: clustercreatetime
258+
Type: string
259+
- Name: vpcsecuritygroups
260+
Type: string
261+
- Name: dbsubnetgroup
262+
Type: string
263+
- Name: latestrestorabletime
264+
Type: string
265+
- Name: availabilityzones
266+
Type: string
267+
- Name: dbclusteroptiongroupmemberships
268+
Type: string
269+
- Name: replicationsourceidentifier
270+
Type: string
271+
- Name: deletionprotection
272+
Type: string
273+
- Name: endpoint
274+
Type: string
275+
- Name: preferredmaintenancewindow
276+
Type: string
277+
- Name: readerendpoint
278+
Type: string
279+
- Name: accountid
280+
Type: string
281+
- Name: enabledcloudwatchlogsexports
282+
Type: string
283+
- Name: scalingconfigurationinfo
284+
Type: string
285+
- Name: storageencrypted
286+
Type: string
287+
- Name: enginemode
288+
Type: string
289+
- Name: databasename
290+
Type: string
291+
- Name: activitystreammode
292+
Type: string
293+
- Name: crossaccountclone
294+
Type: string
295+
- Name: dbclusterarn
296+
Type: string
297+
- Name: activitystreamstatus
298+
Type: string
299+
- Name: allocatedstorage
300+
Type: string
301+
- Name: engineversion
302+
Type: string
303+
- Name: backupretentionperiod
304+
Type: string
305+
- Name: clonegroupid
306+
Type: string
307+
- Name: dbclustermembers
308+
Type: string
309+
- Name: kmskeyid
310+
Type: string
311+
- Name: accountid
312+
Type: string
313+
- Name: collection_date
314+
Type: string
315+
- Name: region
316+
Type: string
317+
InputFormat: org.apache.hadoop.mapred.TextInputFormat
318+
Location: !Sub s3://${DestinationBucket}/inventory/inventory-rds-db-clusters-data/
319+
OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
320+
Parameters:
321+
UPDATED_BY_CRAWLER: !Sub ${ResourcePrefix}inventory-RdsDbClusters-Crawler
322+
SerdeInfo:
323+
Parameters:
324+
paths: readreplicaidentifiers,capacity,charactersetname,preferredbackupwindow,copytagstosnapshot,activitystreamkinesisstreamname,multiaz,backtrackwindow,earliestrestorabletime,engine,earliestbacktracktime,httpendpointenabled,payer_id,percentprogress,day,dbclusterparametergroup,hostedzoneid,status,associatedroles,dbclusteridentifier,backtrackconsumedchangerecords,iamdatabaseauthenticationenabled,serverlessv2scalingconfiguration,customendpoints,port,activitystreamkmskeyid,masterusername,dbclusterresourceid,clustercreatetime,vpcsecuritygroups,dbsubnetgroup,latestrestorabletime,availabilityzones,dbclusteroptiongroupmemberships,replicationsourceidentifier,year,deletionprotection,endpoint,preferredmaintenancewindow,readerendpoint,accountid,enabledcloudwatchlogsexports,scalingconfigurationinfo,storageencrypted,enginemode,databasename,activitystreammode,month,crossaccountclone,dbclusterarn,activitystreamstatus,allocatedstorage,engineversion,backupretentionperiod,clonegroupid,dbclustermembers,kmskeyid,accountid,collection_date,region
325+
SerializationLibrary: org.openx.data.jsonserde.JsonSerDe
326+
192327
RdsDbInstances:
193328
path: rds-db-instances
194329
table:
@@ -1043,6 +1178,12 @@ Resources:
10431178
obj_name='CacheClusters'
10441179
# fields=['CacheClusterId', 'CacheNodeType', 'EngineVersion', 'Engine', 'NumCacheNodes', 'PreferredAvailabilityZone', 'CacheClusterCreateTime'],
10451180
),
1181+
'rds-db-clusters': partial(
1182+
paginated_scan,
1183+
service='rds',
1184+
function_name='describe_db_clusters',
1185+
obj_name='DBClusters[*]'
1186+
),
10461187
'rds-db-instances': partial(
10471188
paginated_scan,
10481189
service='rds',

0 commit comments

Comments
 (0)