List of usage examples for com.amazonaws.services.cloudformation.model UpdateStackRequest withUsePreviousTemplate
public UpdateStackRequest withUsePreviousTemplate(Boolean usePreviousTemplate)
Reuse the existing template that is associated with the stack that you are updating.
From source file:com.nike.cerberus.service.CloudFormationService.java
License:Apache License
/** * Updates an existing stack by name./* w ww. j av a2s .c o m*/ * * @param stackId Stack ID. * @param parameters Input parameters. * @param templatePath Path to the JSON template of the stack. */ public void updateStack(final String stackId, final Map<String, String> parameters, final String templatePath, final boolean iamCapabilities) { final UpdateStackRequest request = new UpdateStackRequest().withStackName(stackId) .withParameters(convertParameters(parameters)); if (StringUtils.isNotBlank(templatePath)) { request.withTemplateBody(getTemplateText(templatePath)); } else { request.withUsePreviousTemplate(true); } if (iamCapabilities) { request.getCapabilities().add("CAPABILITY_IAM"); } cloudFormationClient.updateStack(request); }