in critter/stack.py [0:0]
def update(self):
logger.warning(
f"Warning - Updating existing CloudFormation stack '{self.stack_name}'. Testing using existing stacks may "
"result in unreliable test results. It is recommended to deploy a new stack for each test iteration."
)
if not self.trigger_rule_evaluation:
logger.warning(
"Warning - Updating an existing CloudFormation stack without specifying "
f"'{self.TRIGGER_RULE_EVALUATION_ARG}' may result in the Config rule evaluation never occurring."
)
try:
self.cfn.update_stack(
StackName=self.stack_name,
TemplateBody=self.template_body,
DisableRollback=True,
Capabilities=self.cfn_capabilities,
Tags=self.stack_tags,
)
logger.info(f"Waiting for CloudFormation stack '{self.stack_name}' update to complete")
self.cfn.get_waiter("stack_update_complete").wait(
StackName=self.stack_name, WaiterConfig=self.CFN_WAITER_CONFIG
)
self.deploy_action_performed = "UPDATE"
except botocore.exceptions.ClientError as e:
if "No updates are to be performed" in e.response["Error"]["Message"]:
logger.info(f"No updates are to be performed on CloudFormation stack '{self.stack_name}'")
elif e.response["Error"]["Code"] == "InsufficientCapabilitiesException":
logger.error("Error - Specify required CloudFormation capabilities with '--capabilities CAPABILITY'")
raise e
else:
raise e