Example usage for com.amazonaws.services.cloudformation.model UpdateStackSetRequest setUsePreviousTemplate

List of usage examples for com.amazonaws.services.cloudformation.model UpdateStackSetRequest setUsePreviousTemplate

Introduction

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

Prototype


public void setUsePreviousTemplate(Boolean usePreviousTemplate) 

Source Link

Document

Use the existing template that's associated with the stack set that you're updating.

Usage

From source file:de.taimos.pipeline.aws.cloudformation.stacksets.CloudFormationStackSet.java

License:Apache License

public UpdateStackSetResult update(String templateBody, String templateUrl, Collection<Parameter> params,
        Collection<Tag> tags) {
    this.listener.getLogger().format("Updating CloudFormation stack set %s %n", this.stackSet);
    UpdateStackSetRequest req = new UpdateStackSetRequest().withStackSetName(this.stackSet)
            .withCapabilities(Capability.CAPABILITY_IAM, Capability.CAPABILITY_NAMED_IAM).withParameters(params)
            .withTags(tags);/* w  w w.ja va2s.c  o  m*/

    if (templateBody != null && !templateBody.isEmpty()) {
        req.setTemplateBody(templateBody);
    } else if (templateUrl != null && !templateUrl.isEmpty()) {
        req.setTemplateURL(templateUrl);
    } else {
        req.setUsePreviousTemplate(true);
    }

    UpdateStackSetResult result = this.client.updateStackSet(req);

    this.listener.getLogger().format("Updated CloudFormation stack set %s %n", this.stackSet);
    return result;
}