hamlet-io / executor-bash

Executor for hamlet based on bash
GNU General Public License v3.0
0 stars 4 forks source link

[BUG] Replace template not cancelling update on failure #180

Closed roleyfoley closed 3 years ago

roleyfoley commented 3 years ago

Current Behaviour

When running a replace template pass using CloudFormation and the replace template fails to run, processing continues on to the next replace template file

Expected Behaviour

When a stack execution fails or rolls back it should cancel any further processing and raise an error to the user

Possible Solution

Check for status on repalce stack executions and fail the script

Steps to Reproduce

  1. Add a component which has replace template support ( sqs, rds )
  2. Run a deployment which generates a failure in template processing
  3. Run the deployment and observe the status
(Info) Executing replace template : soln-queue-mswdev02-ap-southeast-2-replace1-template...
{
    "Id": "arn:aws:cloudformation:ap-southeast-2:123456789:changeSet/soln-queue-mswdev02-ap-southeast-2-replace1-template-1616377693/234d196c-d93e-4da2-9e4a-d8a1e34ce2cf",
    "StackId": "arn:aws:cloudformation:ap-southeast-2:123456789:stack/walksregister-integration-roleyfoley-soln-queue/7f69d670-8aad-11eb-8341-06f785856d72"
}
(Info) Watching stack execution...
            "StackStatus": "UPDATE_IN_PROGRESS",
            "StackStatusReason": "User Initiated",
            "StackStatus": "UPDATE_ROLLBACK_COMPLETE",
(Warn) Stack walksregister-integration-roleyfoley-soln-queue could not complete and a rollback was performed
(Info) Executing replace template : soln-queue-mswdev02-ap-southeast-2-replace2-template...
{
    "Id": "arn:aws:cloudformation:ap-southeast-2:123456789:changeSet/soln-queue-mswdev02-ap-southeast-2-replace2-template-1616377758/5fa151c3-7860-44b7-ad85-736219528f3d",
    "StackId": "arn:aws:cloudformation:ap-southeast-2:123456789:stack/walksregister-integration-roleyfoley-soln-queue/7f69d670-8aad-11eb-8341-06f785856d72"
}
(Info) Watching stack execution...
            "StackStatus": "UPDATE_IN_PROGRESS",
            "StackStatusReason": "User Initiated",
            "StackStatus": "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS",
            "StackStatus": "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS",
            "StackStatus": "UPDATE_COMPLETE",
(Info) Update completed for walksregister-integration-roleyfoley-soln-queue