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

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

Introduction

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

Prototype


public void setTemplateBody(String templateBody) 

Source Link

Document

The structure that contains the template body, with a minimum length of 1 byte and a maximum length of 51,200 bytes.

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 .j  a  v a 2 s  . c om*/

    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;
}