Esempio n. 1
0
 def load(self):
     self.stack = self.aws_cfn.Stack(self.stack_name)
     try:
         self.stack.load()
         logger.debug('Loaded Stack: %r', self.stack)
     except ClientError as error:
         logger.error(MESSAGE_STACK_NOT_FOUND.format(
             stack_name=self.stack_name, message=error.message))
         self.notify(DeploymentResponse.STATUS_FAILURE, error.message)
Esempio n. 2
0
 def update(self):
     logger.debug('Parameters to be updated: %s', self.stack.parameters)
     merged = self.stack_update_parameters.merge(self.stack.parameters)
     logger.debug('Merged parameters: %s', merged)
     try:
         logger.debug('Will try to update Cloudformation')
         self.stack.update(
             UsePreviousTemplate=True,
             Parameters=merged,
             Capabilities=['CAPABILITY_IAM'],
             NotificationARNs=self.cfn_output_topics)
         message = 'Cloudformation was triggered successfully.'
         logger.debug(message)
         self.notify(DeploymentResponse.STATUS_SUCCESS, message)
     except ClientError as error:
         logger.error(MESSAGE_UPDATE_PROBLEM.format(
             stack_name=self.stack_name, message=error.message))
         self.notify(DeploymentResponse.STATUS_FAILURE, error.message)