Exception lastException = null;
for (int i = 1; i <= maxAttempts; i++) {
getLog().info(format("Terminating environmentId=%s (attempt %d/%d)", environmentId, i, maxAttempts));
try {
TerminateEnvironmentContext terminatecontext = new TerminateEnvironmentContextBuilder()
.withEnvironmentId(environmentId)
.withTerminateResources(true).build();
TerminateEnvironmentCommand command = new TerminateEnvironmentCommand(
this);