Example usage for com.amazonaws.services.cloudformation.model UpdateStackRequest withParameters

List of usage examples for com.amazonaws.services.cloudformation.model UpdateStackRequest withParameters

Introduction

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

Prototype


public UpdateStackRequest withParameters(java.util.Collection<Parameter> parameters) 

Source Link

Document

A list of Parameter structures that specify input parameters for the stack.

Usage

From source file:br.com.ingenieux.mojo.cloudformation.PushStackMojo.java

License:Apache License

private UpdateStackResult updateStack() throws Exception {
    UpdateStackRequest req = new UpdateStackRequest().withStackName(stackName)
            .withCapabilities(Capability.CAPABILITY_IAM);

    if (null != this.destinationS3Uri) {
        req.withTemplateURL(generateExternalUrl(this.destinationS3Uri));
    } else {/*  w  ww. j a  v a  2  s  .  com*/
        req.withTemplateBody(templateBody);
    }

    req.withNotificationARNs(notificationArns);

    req.withParameters(parameters);
    req.withResourceTypes(resourceTypes);
    req.withTags(tags);

    try {
        return getService().updateStack(req);
    } catch (AmazonServiceException exc) {
        if ("No updates are to be performed.".equals(exc.getErrorMessage())) {
            return null;
        }

        throw exc;
    }
}

From source file:com.carrotgarden.maven.aws.cfn.CarrotCloudForm.java

License:BSD License

public Stack stackUpdate() throws Exception {

    final UpdateStackRequest request = new UpdateStackRequest();

    request.withStackName(name);//  w  w  w  .  java2  s . c o  m
    request.withParameters(paramList);
    request.withTemplateBody(template);

    amazonClient.updateStack(request);

    final Stack stack = waitForStackUpdate();

    return stack;

}

From source file:de.taimos.pipeline.aws.cloudformation.CloudFormationStack.java

License:Apache License

public void update(String templateBody, String templateUrl, Collection<Parameter> params, Collection<Tag> tags,
        long pollIntervallMillis, String roleArn) throws ExecutionException {
    try {/*ww w  .ja v a2s  .  c o m*/
        UpdateStackRequest req = new UpdateStackRequest();
        req.withStackName(this.stack).withCapabilities(Capability.CAPABILITY_IAM,
                Capability.CAPABILITY_NAMED_IAM);

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

        req.withParameters(params).withTags(tags).withRoleARN(roleArn);

        this.client.updateStack(req);

        new EventPrinter(this.client, this.listener).waitAndPrintStackEvents(this.stack,
                this.client.waiters().stackUpdateComplete(), pollIntervallMillis);

        this.listener.getLogger().format("Updated CloudFormation stack %s %n", this.stack);

    } catch (AmazonCloudFormationException e) {
        if (e.getMessage().contains("No updates are to be performed")) {
            this.listener.getLogger().format("No updates were needed for CloudFormation stack %s %n",
                    this.stack);
            return;
        }
        this.listener.getLogger().format("Failed to update CloudFormation stack %s %n", this.stack);
        throw e;
    }
}