Example usage for com.amazonaws.services.cloudformation.model UpdateStackRequest getCapabilities

List of usage examples for com.amazonaws.services.cloudformation.model UpdateStackRequest getCapabilities

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudformation.model UpdateStackRequest getCapabilities.

Prototype


public java.util.List<String> getCapabilities() 

Source Link

Document

In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for AWS CloudFormation to update the stack.

Usage

From source file:com.nike.cerberus.service.CloudFormationService.java

License:Apache License

/**
 * Updates an existing stack by name.//from   w  ww  .j  av a  2 s  . 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);
}