/** * <p> * A structure that contains the body of the revised template, with a minimum length of 1 byte and a maximum length * of 51,200 bytes. AWS CloudFormation generates the change set by comparing this template with the template of the * stack that you specified. * </p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * </p> * * @param templateBody * A structure that contains the body of the revised template, with a minimum length of 1 byte and a maximum * length of 51,200 bytes. AWS CloudFormation generates the change set by comparing this template with the * template of the stack that you specified.</p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChangeSetRequest withTemplateBody(String templateBody) { setTemplateBody(templateBody); return this; }
/** * <p> * The location of the file that contains the revised template. The URL must point to a template (max size: 460,800 * bytes) that is located in an S3 bucket. AWS CloudFormation generates the change set by comparing this template * with the stack that you specified. * </p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * </p> * * @param templateURL * The location of the file that contains the revised template. The URL must point to a template (max size: * 460,800 bytes) that is located in an S3 bucket. AWS CloudFormation generates the change set by comparing * this template with the stack that you specified.</p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChangeSetRequest withTemplateURL(String templateURL) { setTemplateURL(templateURL); return this; }
withChangeSetType(changeSetType);
public void createChangeSet(String changeSetName, String templateBody, String templateUrl, Collection<Parameter> params, Collection<Tag> tags, PollConfiguration pollConfiguration, ChangeSetType changeSetType, String roleArn, RollbackConfiguration rollbackConfig) throws ExecutionException { try { CreateChangeSetRequest req = new CreateChangeSetRequest(); req.withChangeSetName(changeSetName).withStackName(this.stack).withCapabilities(Capability.CAPABILITY_IAM, Capability.CAPABILITY_NAMED_IAM, Capability.CAPABILITY_AUTO_EXPAND).withChangeSetType(changeSetType); throw new IllegalArgumentException("Either a file or url for the template must be specified"); req.withTemplateBody(templateBody).withTemplateURL(templateUrl); } else if (ChangeSetType.UPDATE.equals(changeSetType)) { this.listener.getLogger().format("Creating CloudFormation change set %s for existing stack %s %n", changeSetName, this.stack); 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).withRollbackConfiguration(rollbackConfig);
public String createChangeSet(String changeSetName, String stackName, ChangeSetType changeSetType, String templateBody, Collection<Parameter> parameters) { logger.info("Creating change set for stack {} with name {}, type {} and parameters {}", stackName, changeSetName, changeSetType, parameters); final CreateChangeSetRequest changeSetRequest = new CreateChangeSetRequest() // .withCapabilities(Capability.CAPABILITY_IAM) // .withStackName(stackName) // .withDescription(stackName) // .withChangeSetName(changeSetName) // .withChangeSetType(changeSetType) // .withParameters(parameters).withTemplateBody(templateBody); final CreateChangeSetResult result = cloudFormation.createChangeSet(changeSetRequest); logger.info("Change set created: {}", result); return result.getId(); }
CreateChangeSetRequest req = new CreateChangeSetRequest() .withChangeSetName(changeSetName) .withStackName(stackName) .withParameters(cfnStackParams) .withTags(cfnStackTags); req.setTemplateURL(cfnTemplateUrl); req.setTemplateBody(FileUtils.readFileToString(cfnTemplateFile)); (getUseCapabilityIam() == null) ? Capability.CAPABILITY_IAM : getUseCapabilityIam(); getLogger().info("Using IAM capability: " + selectedCapability); req.setCapabilities(Arrays.asList(selectedCapability.toString()));
capabilitiesCopy.add(value.toString()); if (getCapabilities() == null) { setCapabilities(capabilitiesCopy); } else { getCapabilities().addAll(capabilitiesCopy);
setCapabilities(capabilities); return this;
/** * <p> * Whether to reuse the template that is associated with the stack to create the change set. * </p> * * @param usePreviousTemplate * Whether to reuse the template that is associated with the stack to create the change set. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChangeSetRequest withUsePreviousTemplate(Boolean usePreviousTemplate) { setUsePreviousTemplate(usePreviousTemplate); return this; }
capabilitiesCopy.add(value.toString()); if (getCapabilities() == null) { setCapabilities(capabilitiesCopy); } else { getCapabilities().addAll(capabilitiesCopy);
setCapabilities(new com.amazonaws.internal.SdkInternalList<String>(capabilities.length));
/** * <p> * Whether to reuse the template that is associated with the stack to create the change set. * </p> * * @param usePreviousTemplate * Whether to reuse the template that is associated with the stack to create the change set. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChangeSetRequest withUsePreviousTemplate(Boolean usePreviousTemplate) { setUsePreviousTemplate(usePreviousTemplate); return this; }
/** * <p> * A structure that contains the body of the revised template, with a minimum length of 1 byte and a maximum length * of 51,200 bytes. AWS CloudFormation generates the change set by comparing this template with the template of the * stack that you specified. * </p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * </p> * * @param templateBody * A structure that contains the body of the revised template, with a minimum length of 1 byte and a maximum * length of 51,200 bytes. AWS CloudFormation generates the change set by comparing this template with the * template of the stack that you specified.</p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChangeSetRequest withTemplateBody(String templateBody) { setTemplateBody(templateBody); return this; }
/** * <p> * The location of the file that contains the revised template. The URL must point to a template (max size: 460,800 * bytes) that is located in an S3 bucket. AWS CloudFormation generates the change set by comparing this template * with the stack that you specified. * </p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * </p> * * @param templateURL * The location of the file that contains the revised template. The URL must point to a template (max size: * 460,800 bytes) that is located in an S3 bucket. AWS CloudFormation generates the change set by comparing * this template with the stack that you specified.</p> * <p> * Conditional: You must specify only <code>TemplateBody</code> or <code>TemplateURL</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChangeSetRequest withTemplateURL(String templateURL) { setTemplateURL(templateURL); return this; }
setCapabilities(capabilities); return this;
setCapabilities(new com.amazonaws.internal.SdkInternalList<String>(capabilities.length));