/** * <p> * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more information, * see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> data * type. * </p> * * @param parameters * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more * information, see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> * data type. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateStackRequest withParameters(java.util.Collection<Parameter> parameters) { setParameters(parameters); return this; }
/** * <p> * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more information, * see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> data * type. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setParameters(java.util.Collection)} or {@link #withParameters(java.util.Collection)} if you want to * override the existing values. * </p> * * @param parameters * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more * information, see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> * data type. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateStackRequest withParameters(Parameter... parameters) { if (this.parameters == null) { setParameters(new com.amazonaws.internal.SdkInternalList<Parameter>(parameters.length)); } for (Parameter ele : parameters) { this.parameters.add(ele); } return this; }
/** * <p> * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more information, * see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> data * type. * </p> * * @param parameters * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more * information, see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> * data type. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateStackRequest withParameters(java.util.Collection<Parameter> parameters) { setParameters(parameters); return this; }
/** * <p> * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more information, * see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> data * type. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setParameters(java.util.Collection)} or {@link #withParameters(java.util.Collection)} if you want to * override the existing values. * </p> * * @param parameters * A list of <code>Parameter</code> structures that specify input parameters for the stack. For more * information, see the <a * href="http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html">Parameter</a> * data type. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateStackRequest withParameters(Parameter... parameters) { if (this.parameters == null) { setParameters(new com.amazonaws.internal.SdkInternalList<Parameter>(parameters.length)); } for (Parameter ele : parameters) { this.parameters.add(ele); } return this; }
protected void updateStack(Deployment deployment, String templateBody) throws Exception { String templateName = deployment.getCloudFormationStackName(); UpdateStackRequest updateStackRequest = new UpdateStackRequest(); updateStackRequest.setStackName(templateName); updateStackRequest.setTemplateBody(templateBody); updateStackRequest.setParameters(deployment.getCloudFormationParameters()); updateStackRequest.withCapabilities(Capability.CAPABILITY_IAM); getCloudFormationClient().updateStack(updateStackRequest); log.info("Stack update completed, the stack " + templateName + " completed with " + waitForCompletion()); }
public void execute() { checkParams(); AmazonCloudFormationClient client = getOrCreateClient(AmazonCloudFormationClient.class); UpdateStackRequest request = new UpdateStackRequest() .withStackName(stackName).withStackPolicyBody(stackPolicyBody) .withStackPolicyURL(stackPolicyURL) .withTemplateBody(templateBody).withTemplateURL(templateURL) .withStackPolicyDuringUpdateBody(stackPolicyDuringUpdateBody) .withStackPolicyDuringUpdateURL(stackPolicyDuringUpdateURL) .withUsePreviousTemplate(usePreviousTemplate); if (capabilities.size() > 0) { request.setCapabilities(capabilities); } if (parameters.size() > 0) { request.setParameters(parameters); } if (notificationArns.size() > 0) { request.setNotificationARNs(notificationArns); } try { client.updateStack(request); System.out.println("Update stack " + stackName + " request submitted."); } catch (Exception e) { throw new BuildException("Could not update stack: " + e.getMessage(), e); } }