TIM02144
TIM02144

Reputation: 615

"isEnd":true - does not stop workflow as expected in JSON AWS SSM Automation Doc

I have an AWS SSM automation document with 20 steps. I have the last two steps (19 & 20) setup with "isEnd":true statements but they are not executing as expected. Step 19 should execute this and not move on to step 20 if step 19 succeeds. What is happening is step 19 succeeds and the workflow moves onto step 20

I've tried various syntax and formatting with no luck. I am using the format referenced in AWS's 'Creating Dynamic Automation Workflows with Conditional Branching' instructions, bottom of the page example.

https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-branchdocs.html

    {
      "name": "deleteUnEcryptedImage",
      "action": "aws:deleteImage",
      "maxAttempts": 3,
      "timeoutSeconds": 180,
      "onFailure":"step:PostFailure",
      "inputs": {
        "ImageId": "{{CreateImage.ImageId}}"
        },
        "isEnd":true
    },
    {
      "name": "PostFailure",
      "action": "aws:invokeLambdaFunction",
      "maxAttempts": 3,
      "timeoutSeconds": 180,
      "inputs": {
        "FunctionName": "EOTSS-GoldenAMI-2019-CreationFailure"
        },
        "isEnd":true
    }
  ],
  "outputs": [
    "CreateImage.ImageId"
  ]
}

I expect the workflow to stop after the "deletUnEcrptedImage" step as this step reports as 'Success' in the automation process but instead it moves on to the "PostFailure" step.

Upvotes: 0

Views: 587

Answers (1)

TIM02144
TIM02144

Reputation: 615

It turns out this is working as expected. The AWS SSM automation marks the skipped steps as 'pending' rather than 'skipped' leading me to believe that there was an attempt to move on and process these steps.

Upvotes: 0

Related Questions