Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[step-functions] Syth of addCatch on LambdaInvoke #10530

Closed
allankp opened this issue Sep 25, 2020 · 0 comments · Fixed by #10538
Closed

[step-functions] Syth of addCatch on LambdaInvoke #10530

allankp opened this issue Sep 25, 2020 · 0 comments · Fixed by #10538
Assignees
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. needs-triage This issue or PR still needs to be triaged. p1

Comments

@allankp
Copy link

allankp commented Sep 25, 2020

Cloudformation schema validation failure due to the ordering of addCatch on Lambda function invokes within a StepFunction

Reproduction Steps

  const lambdaInvoke = new LambdaInvoke(
    scope,
    'lambdaName',
    {
      lambdaFunction: props.lambdaFunctions.xxxx,
      qualifier: xxx,
    },
  );
  lambdaInvoke.addCatch(xxxx, {
    resultPath: '$.error',
  });
  lambdaInvoke.addCatch(
    xxx, {
      resultPath: '$.error',
      errors: ['Exception'],
    },
  );

What did you expect to happen?

addCatch is created in the CFN from least specific to most specific

What actually happened?

12:59:28 PM | CREATE_FAILED        | AWS::StepFunctions::StateMachine | xxxxx
Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: States.ALL must appear alone and at end of list at /States/lambdaInvoke/Retry[0]/ErrorEquals[0], SCHEMA_VALIDATION_FAILED: States.ALL must appear alone and at end of l
ist at /States/lambdaInvoke/Catch[0]/ErrorEquals[0], SCHEMA_VALIDATION_FAILED: States.ALL must appear alone and at end of list at /States/lambdaInvoke/Retry[0]/ErrorEquals[0], SCHEMA_VALIDATION_FAILED:
States.ALL must appear alone and at end of list at /States/lambdaInvoke/Catch[0]/ErrorEquals[0]' (Service: AWSStepFunctions; Status Code: 400; Error Code: InvalidDefinition; Request ID: d4dfb385-a7b7-4fce-8b2f-bf08773a3abc; Pro
xy: null)

Environment

  • CLI Version : 1.57.0
  • Framework Version: 1.57.0
  • Node.js Version: v10.22.0
  • OS :
  • Language (Version): TypeScript (3.8.3)

Other


This is 🐛 Bug Report

@allankp allankp added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 25, 2020
@allankp allankp changed the title [step-function] Syth of addCatch on LambdaInvoke [step-functions] Syth of addCatch on LambdaInvoke Sep 25, 2020
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Sep 25, 2020
jogold added a commit to jogold/aws-cdk that referenced this issue Sep 25, 2020
… arrays

Validate that `States.ALL` is not combined with other errors in `Retry`
and `Catch` arrays and sort those arrays so that `States.ALL` appears
last.

Closes aws#10530
jogold added a commit to jogold/aws-cdk that referenced this issue Sep 25, 2020
… arrays

Validate that `States.ALL` is not combined with other errors in `Retry`
and `Catch` arrays and sort those arrays so that `States.ALL` appears
last.

Closes aws#10530
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Sep 25, 2020
@shivlaks shivlaks added p1 effort/small Small work item – less than a day of effort labels Sep 29, 2020
@mergify mergify bot closed this as completed in #10538 Sep 29, 2020
mergify bot pushed a commit that referenced this issue Sep 29, 2020
… arrays (#10538)

Validate that `States.ALL` is not combined with other errors in `Retry`
and `Catch` arrays and sort those arrays so that `States.ALL` appears
last.

Closes #10530


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. needs-triage This issue or PR still needs to be triaged. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants