use of com.amazonaws.services.rds.model.DeleteDBSecurityGroupRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class DatabaseSecuritySetup method teardownResources.
/*
* Teardown the database security groups needed for stack instance
*
*/
public void teardownResources() {
DeleteDBSecurityGroupRequest req;
if (resources.getStackInstancesDatabaseSecurityGroup() != null) {
req = new DeleteDBSecurityGroupRequest().withDBSecurityGroupName(config.getStackDatabaseSecurityGroupName());
rdsClient.deleteDBSecurityGroup(req);
resources.setStackInstancesDatabaseSecurityGroup(null);
}
}
use of com.amazonaws.services.rds.model.DeleteDBSecurityGroupRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class DatabaseSecuritySetupTest method testTeardownResources.
@Test
public void testTeardownResources() {
resources.setIdGeneratorDatabaseSecurityGroup(new DBSecurityGroup().withDBSecurityGroupName(config.getIdGeneratorDatabaseSecurityGroupName()));
resources.setStackInstancesDatabaseSecurityGroup(new DBSecurityGroup().withDBSecurityGroupName(config.getStackDatabaseSecurityGroupName()));
DeleteDBSecurityGroupRequest req = new DeleteDBSecurityGroupRequest().withDBSecurityGroupName(resources.getStackInstancesDatabaseSecurityGroup().getDBSecurityGroupName());
databaseSecuritySetup.teardownResources();
verify(mockClient, times(1)).deleteDBSecurityGroup(req);
assertNotNull(resources.getIdGeneratorDatabaseSecurityGroup());
assertNull(resources.getStackInstancesDatabaseSecurityGroup());
}
Aggregations