List of usage examples for com.amazonaws.services.cloudformation.model CreateStackRequest withStackName
public CreateStackRequest withStackName(String stackName)
The name that is associated with the stack.
From source file:com.carrotgarden.maven.aws.cfn.CarrotCloudForm.java
License:BSD License
/** *///from w w w . j ava2 s . c o m public Stack stackCreate() throws Exception { final CreateStackRequest request = new CreateStackRequest(); request.withStackName(name); request.withParameters(paramList); request.withTemplateBody(template); amazonClient.createStack(request); final Stack stack = waitForStackCreate(); return stack; }
From source file:de.taimos.pipeline.aws.cloudformation.CloudFormationStack.java
License:Apache License
public void create(String templateBody, String templateUrl, Collection<Parameter> params, Collection<Tag> tags, Integer timeoutInMinutes, long pollIntervallMillis, String roleArn, String onFailure) throws ExecutionException { if ((templateBody == null || templateBody.isEmpty()) && (templateUrl == null || templateUrl.isEmpty())) { throw new IllegalArgumentException("Either a file or url for the template must be specified"); }//from w w w . ja v a 2 s . c o m CreateStackRequest req = new CreateStackRequest(); req.withStackName(this.stack).withCapabilities(Capability.CAPABILITY_IAM, Capability.CAPABILITY_NAMED_IAM); req.withTemplateBody(templateBody).withTemplateURL(templateUrl).withParameters(params).withTags(tags) .withTimeoutInMinutes(timeoutInMinutes).withRoleARN(roleArn) .withOnFailure(OnFailure.valueOf(onFailure)); this.client.createStack(req); new EventPrinter(this.client, this.listener).waitAndPrintStackEvents(this.stack, this.client.waiters().stackCreateComplete(), pollIntervallMillis); }