Example usage for com.amazonaws.services.cloudformation.model CreateStackRequest setNotificationARNs

List of usage examples for com.amazonaws.services.cloudformation.model CreateStackRequest setNotificationARNs

Introduction

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

Prototype


public void setNotificationARNs(java.util.Collection<String> notificationARNs) 

Source Link

Document

The Simple Notification Service (SNS) topic ARNs to publish stack related events.

Usage

From source file:org.xmlsh.aws.cfnCreateStack.java

License:BSD License

private int createStack(Options opts) throws IOException, XMLStreamException, SaxonApiException, CoreException {

    OutputPort stdout = getStdout();//from   ww  w  .  j  a  v a2 s. com
    mWriter = new SafeXMLStreamWriter(stdout.asXMLStreamWriter(getSerializeOpts()));

    startDocument();
    startElement(getName());

    CreateStackRequest request = new CreateStackRequest();

    // "capability:+,disable-rollback,notification-arn:+,name:,template:,timeout:,tag:+");

    if (opts.hasOpt("capability"))
        request.setCapabilities(Util.toStringList(opts.getOptValues("capability")));

    String onFail = opts.getOptString("on-failure", null);
    if (onFail != null)
        request.setOnFailure(OnFailure.fromValue(onFail));
    else
        request.setDisableRollback(opts.getOptFlag("disable-rollback", false));

    if (opts.hasOpt("notification-arn"))
        request.setNotificationARNs(Util.toStringList(opts.getOptValues("notification-arn")));

    request.setStackName(opts.getOptStringRequired("name"));

    if (opts.hasOpt("template-file"))
        request.setTemplateBody(Util.readString(mShell.getFile(opts.getOptValue("template-file")),
                getSerializeOpts().getInput_text_encoding()));
    else
        request.setTemplateURL(opts.getOptStringRequired("template-url"));

    if (opts.hasOpt("timeout"))
        request.setTimeoutInMinutes((int) opts.getOptLong("timeout", 10));
    if (opts.hasOpt("tag"))
        request.setTags(getTags(opts.getOptValues("tag")));

    request.setParameters(getParameters(opts));

    traceCall("createStack");

    CreateStackResult result = getAWSClient().createStack(request);

    writeStackResult(result, request.getStackName());

    endElement();
    endDocument();
    closeWriter();

    stdout.writeSequenceTerminator(getSerializeOpts());

    return 0;

}