Skip to content

Commit

Permalink
Add more kinds of DatabaseEngines to RDS (#123)
Browse files Browse the repository at this point in the history
* Add more kinds of DatabaseEngines to RDS
  • Loading branch information
cregev authored Jul 29, 2020
1 parent ea48a2a commit bda9880
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion collector/aws/resources/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ func (r *RDSManager) getPricingFilterInput(instance *rds.DBInstance) pricing.Get
switch *instance.Engine {
case "postgres":
databaseEngine = "PostgreSQL"
case "aurora":
case "aurora", "aurora-mysql":
databaseEngine = "Aurora MySQL"
case "aurora-postgresql":
databaseEngine = "Aurora PostgreSQL"
default:
databaseEngine = *instance.Engine
}
Expand Down
12 changes: 10 additions & 2 deletions collector/aws/resources/rds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ var defaultRDSMock = rds.DescribeDBInstancesOutput{
Engine: awsClient.String("docdb"),
InstanceCreateTime: testutils.TimePointer(time.Now()),
},
{
DBInstanceArn: awsClient.String("ARN::5"),
DBInstanceIdentifier: awsClient.String("i-5"),
MultiAZ: testutils.BoolPointer(false),
DBInstanceClass: awsClient.String("t2.micro"),
Engine: awsClient.String("aurora-mysql"),
InstanceCreateTime: testutils.TimePointer(time.Now()),
},
},
}

Expand Down Expand Up @@ -91,8 +99,8 @@ func TestDescribeRDSInstances(t *testing.T) {

result, _ := rdsManager.describeInstances(nil, nil)

if len(result) != 3 {
t.Fatalf("unexpected rds instance count, got %d expected %d", len(result), 3)
if len(result) != 4 {
t.Fatalf("unexpected rds instance count, got %d expected %d", len(result), 4)
}
})

Expand Down

0 comments on commit bda9880

Please sign in to comment.