Skip to content

Commit

Permalink
🐛 fix aws rds dbclusters members (#2944)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeffrey authored Jan 4, 2024
1 parent 63b2d40 commit 08f3b8d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions providers/aws/resources/aws_rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,17 @@ func (a *mqlAwsRds) getDbClusters(conn *connection.AwsConnection) []*jobpool.Job
}

for _, cluster := range dbClusters.DBClusters {
// mqlRdsDbInstances := []*mqlRdsDbInstance{}
// for _, instance := range cluster.DBClusterMembers {
// mqlInstance, err := NewResource(a.MqlRuntime, "aws.rds.dbinstance",
// map[string]*llx.RawData{
// "arn": llx.StringData(fmt.Sprintf(rdsInstanceArnPattern, regionVal, conn, conn.AccountId(), convert.ToString(instance.DBInstanceIdentifier))),
// })
// if err != nil {
// return nil, err
// }
// mqlRdsDbInstances = append(mqlRdsDbInstances, mqlInstance)
// }
mqlRdsDbInstances := []interface{}{}
for _, instance := range cluster.DBClusterMembers {
mqlInstance, err := NewResource(a.MqlRuntime, "aws.rds.dbinstance",
map[string]*llx.RawData{
"arn": llx.StringData(fmt.Sprintf(rdsInstanceArnPattern, regionVal, conn.AccountId(), convert.ToString(instance.DBInstanceIdentifier))),
})
if err != nil {
return nil, err
}
mqlRdsDbInstances = append(mqlRdsDbInstances, mqlInstance)
}
sgs := []interface{}{}
for i := range cluster.VpcSecurityGroups {
// NOTE: this will create the resource and determine the data in its init method
Expand Down Expand Up @@ -271,7 +271,7 @@ func (a *mqlAwsRds) getDbClusters(conn *connection.AwsConnection) []*jobpool.Job
"storageType": llx.StringDataPtr(cluster.StorageType),
"tags": llx.MapData(rdsTagsToMap(cluster.TagList), types.String),
"securityGroups": llx.ArrayData(sgs, types.Resource("aws.ec2.securitygroup")),
// "members": mqlRdsDbInstances,
"members": llx.ArrayData(mqlRdsDbInstances, types.Resource("aws.rds.dbinstance")),
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 08f3b8d

Please sign in to comment.