use of com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest in project Synapse-Stack-Builder by Sage-Bionetworks.
the class ElasticBeanstalkSetup method terminateEnvironment.
/**
* Delete a single environment
*/
public void terminateEnvironment(String servicePrefix) {
final String environmentName = config.getEnvironmentName(servicePrefix);
final String environmentCName = config.getEnvironmentCNAMEPrefix(servicePrefix);
EnvironmentDescription environment = describeEnvironment(environmentName);
if (environment == null) {
// Nothing to do except logger
logger.debug(String.format("Environment name: '%1$s' does not exist!!!", environmentName, environmentCName));
} else {
// Delete environment
logger.debug(String.format("Terminating environment name: '%1$s' with CNAME: '%2$s' ", environmentName, environmentCName));
String environmentId = environment.getEnvironmentId();
TerminateEnvironmentRequest ter = new TerminateEnvironmentRequest().withEnvironmentId(environmentId).withTerminateResources(Boolean.TRUE);
TerminateEnvironmentResult terminateResult = beanstalkClient.terminateEnvironment(ter);
}
}
Aggregations