Skip to content

Commit

Permalink
[DBInstance] Fix false drift detector on Oracle DBName (#411)
Browse files Browse the repository at this point in the history
Oracle engine uppercases the database name. This causes a false drift
alarm. This commit adds uppercased DBName spelling to the list of valid
options RDS API could return.

Fixes aws-cloudformation/cloudformation-coverage-roadmap#1530.

Signed-off-by: Oleg Sidorov <[email protected]>
  • Loading branch information
Oleg Sidorov committed Feb 22, 2023
1 parent 27cd75a commit 5b4b0ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aws-rds-dbinstance/aws-rds-dbinstance.json
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
"/properties/DBClusterSnapshotIdentifier": "$lowercase(DBClusterSnapshotIdentifier)",
"/properties/DBInstanceIdentifier": "$lowercase(DBInstanceIdentifier)",
"/properties/DBParameterGroupName": "$lowercase(DBParameterGroupName)",
"/properties/DBName": "$lowercase(DBName)",
"/properties/DBName": "$lowercase(DBName) $OR $uppercase(DBName)",
"/properties/DBSnapshotIdentifier": "$lowercase(DBSnapshotIdentifier)",
"/properties/DBSubnetGroupName": "$lowercase(DBSubnetGroupName)",
"/properties/Engine": "$lowercase(Engine)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,15 @@ public void testDrift_DBName_Lowercase() {
.build();
ResourceDriftTestHelper.assertResourceNotDrifted(input, output, resourceSchema);
}

@Test
public void testDrift_DBName_Oracle_Uppercase() {
final ResourceModel input = ResourceModel.builder()
.dBName("Oracle_DB")
.build();
final ResourceModel output = ResourceModel.builder()
.dBName("ORACLE_DB")
.build();
ResourceDriftTestHelper.assertResourceNotDrifted(input, output, resourceSchema);
}
}

0 comments on commit 5b4b0ff

Please sign in to comment.