use of com.amazonaws.services.rds.model.DeleteDBInstanceRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class MySqlDatabaseSetup method deleteStackInstanceDatabaseInstance.
/*
/*
* Delete stack instance database
*/
public void deleteStackInstanceDatabaseInstance() {
// Build the request to delete the stack instance database
DeleteDBInstanceRequest req = buildStackInstanceDeleteDBInstanceRequest();
DBInstance inst = deleteDatabaseInstance(req);
}
use of com.amazonaws.services.rds.model.DeleteDBInstanceRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class MySqlDatabaseSetupTest method testBuildIdGeneratorDeleteDBInstanceRequestNonProduction.
@Test
public void testBuildIdGeneratorDeleteDBInstanceRequestNonProduction() throws IOException {
setupDevelopmentConfig();
DeleteDBInstanceRequest expectedReq = new DeleteDBInstanceRequest();
expectedReq.setDBInstanceIdentifier(config.getIdGeneratorDatabaseIdentifier());
expectedReq.setSkipFinalSnapshot(Boolean.TRUE);
DeleteDBInstanceRequest req = databaseSetup.buildIdGeneratorDeleteDBInstanceRequest();
assertEquals(expectedReq, req);
}
use of com.amazonaws.services.rds.model.DeleteDBInstanceRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class MySqlDatabaseSetupTest method testDeleteDatabaseInstanceDoesNotExist.
@Test
public void testDeleteDatabaseInstanceDoesNotExist() {
// Should just be a no-op
DeleteDBInstanceRequest req = new DeleteDBInstanceRequest();
when(mockClient.deleteDBInstance(req)).thenThrow(new DBInstanceNotFoundException("Database instance does not exist"));
DBInstance inst = databaseSetup.deleteDatabaseInstance(req);
assertNull(inst);
}
use of com.amazonaws.services.rds.model.DeleteDBInstanceRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class MySqlDatabaseSetupTest method testBuildStackInstanceDeleteDBInstanceRequestNonProduction.
@Test
public void testBuildStackInstanceDeleteDBInstanceRequestNonProduction() throws IOException {
setupDevelopmentConfig();
DeleteDBInstanceRequest expectedReq = new DeleteDBInstanceRequest();
expectedReq.setDBInstanceIdentifier(config.getStackInstanceDatabaseIdentifier());
expectedReq.setSkipFinalSnapshot(Boolean.TRUE);
DeleteDBInstanceRequest req = databaseSetup.buildStackInstanceDeleteDBInstanceRequest();
assertEquals(expectedReq, req);
}
use of com.amazonaws.services.rds.model.DeleteDBInstanceRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class MySqlDatabaseSetup method buildIdGeneratorDeleteDBInstanceRequest.
/*
* NOTE: Do not call unless deleting shared resources!!!
*/
DeleteDBInstanceRequest buildIdGeneratorDeleteDBInstanceRequest() {
DeleteDBInstanceRequest req = new DeleteDBInstanceRequest();
req.setDBInstanceIdentifier(config.getIdGeneratorDatabaseIdentifier());
if (config.isProductionStack()) {
req.setSkipFinalSnapshot(Boolean.FALSE);
// TODO: Come up with better name for final snapshot
req.setFinalDBSnapshotIdentifier(config.getStack() + config.getStackInstance());
} else {
req.setSkipFinalSnapshot(Boolean.TRUE);
}
return req;
}
Aggregations