use of com.amazonaws.services.rds.model.DeleteDBInstanceRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class MySqlDatabaseSetup method buildStackInstanceDeleteDBInstanceRequest.
DeleteDBInstanceRequest buildStackInstanceDeleteDBInstanceRequest() {
DeleteDBInstanceRequest req = new DeleteDBInstanceRequest();
req.setDBInstanceIdentifier(config.getStackInstanceDatabaseIdentifier());
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;
}
use of com.amazonaws.services.rds.model.DeleteDBInstanceRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class MySqlDatabaseSetupTest method testBuildStackInstanceDeleteDBInstanceRequestProduction.
@Test
public void testBuildStackInstanceDeleteDBInstanceRequestProduction() throws IOException {
setupProductionConfig();
DeleteDBInstanceRequest expectedReq = new DeleteDBInstanceRequest();
expectedReq.setDBInstanceIdentifier(config.getStackInstanceDatabaseIdentifier());
expectedReq.setSkipFinalSnapshot(Boolean.FALSE);
expectedReq.setFinalDBSnapshotIdentifier(config.getStack() + config.getStackInstance());
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 MySqlDatabaseSetupTest method testBuildIdGeneratorDeleteDBInstanceRequestProduction.
@Test
public void testBuildIdGeneratorDeleteDBInstanceRequestProduction() throws IOException {
setupProductionConfig();
DeleteDBInstanceRequest expectedReq = new DeleteDBInstanceRequest();
expectedReq.setDBInstanceIdentifier(config.getIdGeneratorDatabaseIdentifier());
expectedReq.setSkipFinalSnapshot(Boolean.FALSE);
expectedReq.setFinalDBSnapshotIdentifier(config.getStack() + config.getStackInstance());
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 testDeleteDatabaseInstanceDoesExist.
@Test
public void testDeleteDatabaseInstanceDoesExist() {
DeleteDBInstanceRequest req = new DeleteDBInstanceRequest();
req.setDBInstanceIdentifier("someDB");
when(mockClient.deleteDBInstance(req)).thenReturn(new DBInstance().withDBInstanceIdentifier("someDB"));
DBInstance inst = databaseSetup.deleteDatabaseInstance(req);
assertEquals(inst.getDBInstanceIdentifier(), "someDB");
}
Aggregations