/**
  * Create the stack represented by the supplied model using the
  * CloudFormation API.
  *
  * @param Stack $stack Model of the stack to create.
  * @return string Id of the created stack.
  */
 public function create(Stack $stack)
 {
     $response = $this->cloudFormation->CreateStack(['Capabilities' => ['CAPABILITY_IAM'], 'OnFailure' => 'DO_NOTHING', 'Parameters' => $stack->getParameters()->toCloudFormationRequestArgument(), 'StackName' => $stack->getName(), 'TemplateURL' => $this->templateSquashingService->getSquashedTemplateURL($stack->getTemplate()), 'Tags' => $stack->getTags()->toCloudFormationRequestArgument()]);
     return $response['StackId'];
 }
Esempio n. 2
0
 /**
  * Check if this stack is identical to the supplied stack object (i.e. has
  * the same template body and parrameters).
  *
  * @param Stack $stack Stack to compare this stack to.
  * @return boolean Whether the two stacks objects are identical.
  */
 public function isIdentical(self $stack)
 {
     return $this->getTemplate()->isIdentical($stack->getTemplate()) && $this->getParameters()->isIdentical($stack->getParameters()) && $this->getTags()->isIdentical($stack->getTags());
 }