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

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

Introduction

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

Prototype


public void setTimeoutInMinutes(Integer timeoutInMinutes) 

Source Link

Document

The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to false, the stack will be rolled back.

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 w  w w . ja v a 2s  .  c o  m
    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;

}