Search in sources :

Example 1 with DeleteDBSecurityGroupRequest

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);
    }
}
Also used : DeleteDBSecurityGroupRequest(com.amazonaws.services.rds.model.DeleteDBSecurityGroupRequest)

Example 2 with DeleteDBSecurityGroupRequest

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());
}
Also used : DeleteDBSecurityGroupRequest(com.amazonaws.services.rds.model.DeleteDBSecurityGroupRequest) DBSecurityGroup(com.amazonaws.services.rds.model.DBSecurityGroup) Test(org.junit.Test)

Aggregations

DeleteDBSecurityGroupRequest (com.amazonaws.services.rds.model.DeleteDBSecurityGroupRequest)2 DBSecurityGroup (com.amazonaws.services.rds.model.DBSecurityGroup)1 Test (org.junit.Test)1