Skip to content

(step-functions): Bug with payloadResponseOnly attribute of LambdaInvoke #12935

@eladb

Description

@eladb

There is an issue with payloadResponseOnly attribute of LambdaInvoke class.

Reproduction Steps

const getRDSInstanceStatus = new tasks.LambdaInvoke(this, GET_RDS_INSTANCE_STATUS, {
            comment: 'Gets RDS Instance Status for FRS',
            lambdaFunction: rdsProvisioningHandler,
            payloadResponseOnly: true,
            resultPath: '$.output.FrsAfe3SetupStateMachine.GetRDSInstanceStatus',
            payload: sfn.TaskInput.fromJsonPathAt('$.input.FrsAfe3SetupStateMachine.ProvisionRDSInstance')
        });

What did you expect to happen?

Expected: When this property is set to true it should only copy the response payload to the output instead of adding response metadata.

What actually happened?

Actual: When this property is set to true, it distorts the function parameters defined in state machine.

Generated step function definition by CDK:

"GetRDSInstanceStatus": {
      "Next": "Is RDS Instance Available?",
      "Retry": [
        {
          "ErrorEquals": [
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException"
          ],
          "IntervalSeconds": 2,
          "MaxAttempts": 6,
          "BackoffRate": 2
        }
      ],
      "Type": "Task",
      "Comment": "Gets RDS Instance Status for FRS",
      "ResultPath": "$.output.FrsAfe3SetupStateMachine.GetRDSInstanceStatus",
      "Resource": "arn:aws:lambda:us-east-1:711291995544:function:FrsRDSProvisioningHandler",
      "Parameters": {
        "0": "$",
        "1": "{",
        "2": "T",
        "3": "o",
        "4": "k",
        "5": "e",
        "6": "n",
        "7": "[",
        "8": "i",
        "9": "n",
        "10": "p",
        "11": "u",
        "12": "t",
        "13": ".",
        "14": "F",
        "15": "r",
        "16": "s",
        "17": "A",
        "18": "f",
        "19": "e",
        "20": "3",
        "21": "S",
        "22": "e",
        "23": "t",
        "24": "u",
        "25": "p",
        "26": "S",
        "27": "t",
        "28": "a",
        "29": "t",
        "30": "e",
        "31": "M",
        "32": "a",
        "33": "c",
        "34": "h",
        "35": "i",
        "36": "n",
        "37": "e",
        "38": ".",
        "39": "G",
        "40": "e",
        "41": "t",
        "42": "R",
        "43": "D",
        "44": "S",
        "45": "I",
        "46": "n",
        "47": "s",
        "48": "t",
        "49": "a",
        "50": "n",
        "51": "c",
        "52": "e",
        "53": "S",
        "54": "t",
        "55": "a",
        "56": "t",
        "57": "u",
        "58": "s",
        "59": ".",
        "60": "1",
        "61": "7",
        "62": "6",
        "63": "1",
        "64": "]",
        "65": "}"
      }
    }

Environment

  • CDK CLI Version : ?
  • Framework Version: ?
  • Node.js Version: ?
  • OS : ?
  • Language (Version): ?

Other

Internal reference: V315985769


This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-stepfunctions-tasksbugThis issue is a bug.closed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions