Example usage for com.amazonaws.services.cloudformation.model CreateStackSetRequest CreateStackSetRequest

List of usage examples for com.amazonaws.services.cloudformation.model CreateStackSetRequest CreateStackSetRequest

Introduction

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

Prototype

CreateStackSetRequest

Source Link

Usage

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

License:Apache License

public CreateStackSetResult create(String templateBody, String templateUrl, Collection<Parameter> params,
        Collection<Tag> tags) {
    if ((templateBody == null || templateBody.isEmpty()) && (templateUrl == null || templateUrl.isEmpty())) {
        throw new IllegalArgumentException("Either a file or url for the template must be specified");
    }//from   ww w.  jav a  2  s  . co m

    this.listener.getLogger().println("Creating stack set " + this.stackSet);
    CreateStackSetRequest req = new CreateStackSetRequest().withStackSetName(this.stackSet)
            .withCapabilities(Capability.CAPABILITY_IAM, Capability.CAPABILITY_NAMED_IAM)
            .withTemplateBody(templateBody).withTemplateURL(templateUrl).withParameters(params).withTags(tags);
    CreateStackSetResult result = this.client.createStackSet(req);
    this.listener.getLogger().println("Created Stack set stackSetId=" + result.getStackSetId());
    return result;
}