@TaskAction public void deleteStack() { DeleteStackRequest deleteStackRequest = new DeleteStackRequest(); deleteStackRequest.withStackName(stackName); client.deleteStack(deleteStackRequest); } }
public void deleteStack(String stackName) { logger.info("Delete stack '{}'", stackName); cloudFormation.deleteStack(new DeleteStackRequest().withStackName(stackName)); } }
@TaskAction public void deleteStack() { // to enable conventionMappings feature String stackName = getStackName(); if (stackName == null) { throw new GradleException("stackName is not specified"); } AmazonCloudFormationPluginExtension ext = getProject().getExtensions().getByType(AmazonCloudFormationPluginExtension.class); AmazonCloudFormation cfn = ext.getClient(); cfn.deleteStack(new DeleteStackRequest().withStackName(stackName)); getLogger().info("delete stack " + stackName + " requested"); } }
/** * @return */ public boolean delete() { if (isPrefixSelected) { stackName = getOldestStackNameWithPrefix(); } logger.println("Deleting Cloud Formation stack: " + getExpandedStackName()); DeleteStackRequest deleteStackRequest = new DeleteStackRequest(); deleteStackRequest.withStackName(getExpandedStackName()); amazonClient.deleteStack(deleteStackRequest); boolean result = waitForStackToBeDeleted(); logger.println("Cloud Formation stack: " + getExpandedStackName() + (result ? " deleted successfully" : " failed deleting.")); return result; }
private void deleteStack(AmazonCloudFormation cfn) throws InterruptedException { // to enable conventionMappings feature String stackName = getStackName(); getLogger().info("delete stack: {}", stackName); cfn.deleteStack(new DeleteStackRequest().withStackName(stackName)); getLogger().info("delete requested: {}", stackName); Thread.sleep(3000); }
public void delete(PollConfiguration pollConfiguration) throws ExecutionException { this.client.deleteStack(new DeleteStackRequest().withStackName(this.stack)); new EventPrinter(this.client, this.listener).waitAndPrintStackEvents(this.stack, this.client.waiters().stackDeleteComplete(), pollConfiguration); }
@Override protected Object executeInternal() throws Exception { shouldFailIfMissingStack(failIfMissing); getService().deleteStack(new DeleteStackRequest().withStackName(this.stackName).withRetainResources(retainResources)); WaitForStackCommand.WaitForStackContext ctx = new WaitForStackCommand.WaitForStackContext(this.stackName, getService(), this, 30, asList(StackStatus.DELETE_COMPLETE)); new WaitForStackCommand(ctx).execute(); return null; } }
public void execute() { checkParams(); AmazonEC2Client ec2Client = getOrCreateClient(AmazonEC2Client.class); ec2Client .deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName)); AmazonCloudFormationClient cloudFormationClient = getOrCreateClient(AmazonCloudFormationClient.class); cloudFormationClient.deleteStack(new DeleteStackRequest() .withStackName(stackName)); } }
.withStackName(stackName);