Skip to content

Commit

Permalink
✨ Add new fields for AWS RDS DB instances and clusters (#3634)
Browse files Browse the repository at this point in the history
- hostedZoneId
- masterUsername
- latestRestorableTime

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Mar 26, 2024
1 parent 3b816bb commit fa7d454
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
10 changes: 10 additions & 0 deletions providers/aws/resources/aws.lr
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,12 @@ private aws.rds.dbcluster @defaults("id region") {
port int
// The connection endpoint for the primary instance of the DB cluster
endpoint string
// The cluster hosted zone ID
hostedZoneId string
// The master username for the DB instance
masterUsername string
// The latest time to which a database can be restored with point-in-time restore
latestRestorableTime time
}

// Amazon RDS snapshot
Expand Down Expand Up @@ -1918,6 +1924,10 @@ private aws.rds.dbinstance @defaults("id region engine engineVersion") {
port int
// The connection endpoint for the DB instance
endpoint string
// The master username for the DB instance
masterUsername string
// The latest time to which a database can be restored with point-in-time restore
latestRestorableTime time
}

// Amazon ElastiCache
Expand Down
60 changes: 60 additions & 0 deletions providers/aws/resources/aws.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion providers/aws/resources/aws.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,13 @@ resources:
min_mondoo_version: 9.0.0
engineVersion:
min_mondoo_version: 9.0.0
hostedZoneId:
min_mondoo_version: 9.0.0
id: {}
latestRestorableTime:
min_mondoo_version: 9.0.0
masterUsername:
min_mondoo_version: 9.0.0
members: {}
multiAZ:
min_mondoo_version: 9.0.0
Expand Down Expand Up @@ -2039,6 +2045,10 @@ resources:
min_mondoo_version: 9.0.0
enhancedMonitoringResourceArn: {}
id: {}
latestRestorableTime:
min_mondoo_version: 9.0.0
masterUsername:
min_mondoo_version: 9.0.0
multiAZ: {}
name: {}
port:
Expand Down Expand Up @@ -2548,7 +2558,7 @@ resources:
scope: {}
subnets: {}
tags: {}
min_mondoo_version: latest
min_mondoo_version: 9.0.0
platform:
name:
- aws
Expand Down
7 changes: 6 additions & 1 deletion providers/aws/resources/aws_rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ func (a *mqlAwsRds) getDbInstances(conn *connection.AwsConnection) []*jobpool.Jo
"dbInstanceIdentifier": llx.StringDataPtr(dbInstance.DBInstanceIdentifier),
"deletionProtection": llx.BoolDataPtr(dbInstance.DeletionProtection),
"enabledCloudwatchLogsExports": llx.ArrayData(stringSliceInterface, types.String),
"endpoint": llx.StringDataPtr(dbInstance.Endpoint.Address),
"engine": llx.StringDataPtr(dbInstance.Engine),
"engineVersion": llx.StringDataPtr(dbInstance.EngineVersion),
"enhancedMonitoringResourceArn": llx.StringDataPtr(dbInstance.EnhancedMonitoringResourceArn),
"id": llx.StringDataPtr(dbInstance.DBInstanceIdentifier),
"latestRestorableTime": llx.TimeDataPtr(dbInstance.LatestRestorableTime),
"masterUsername": llx.StringDataPtr(dbInstance.MasterUsername),
"multiAZ": llx.BoolDataPtr(dbInstance.MultiAZ),
"name": llx.StringDataPtr(dbInstance.DBName),
"port": llx.IntDataDefault(dbInstance.DbInstancePort, 0),
Expand All @@ -114,7 +117,6 @@ func (a *mqlAwsRds) getDbInstances(conn *connection.AwsConnection) []*jobpool.Jo
"storageIops": llx.IntDataDefault(dbInstance.Iops, 0),
"storageType": llx.StringDataPtr(dbInstance.StorageType),
"tags": llx.MapData(rdsTagsToMap(dbInstance.TagList), types.String),
"endpoint": llx.StringDataPtr(dbInstance.Endpoint.Address),
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -268,7 +270,10 @@ func (a *mqlAwsRds) getDbClusters(conn *connection.AwsConnection) []*jobpool.Job
"endpoint": llx.StringDataPtr(cluster.Endpoint),
"engine": llx.StringDataPtr(cluster.Engine),
"engineVersion": llx.StringDataPtr(cluster.EngineVersion),
"hostedZoneId": llx.StringDataPtr(cluster.HostedZoneId),
"id": llx.StringDataPtr(cluster.DBClusterIdentifier),
"latestRestorableTime": llx.TimeDataPtr(cluster.LatestRestorableTime),
"masterUsername": llx.StringDataPtr(cluster.MasterUsername),
"members": llx.ArrayData(mqlRdsDbInstances, types.Resource("aws.rds.dbinstance")),
"multiAZ": llx.BoolDataPtr(cluster.MultiAZ),
"port": llx.IntDataDefault(cluster.Port, -1),
Expand Down

0 comments on commit fa7d454

Please sign in to comment.