profile
viewpoint

Ask questionsMultiple ways to invoke Lambda function as a Step Functions task

<!-- short description of the feature you are proposing: -->

There are currently multiple ways to invoke a Lambda function through Step Functions tasks

InvokeFunction - initial offering by Step Functions to invoke a Lambda function. RunLambdaTask - latest mechanism to invoke a Lambda function. includes all the functionality as InvokeFunction but also enables the capability to pause a workflow until a task token is returned or fire and forget.

Both of these mechanisms are valid in the Amazon States Language

Proposed Solution

<!-- Please include prototype/workaround/sketch/reference implementation: -->

  • Mark the InvokeFunction task as as deprecated and guide users towards using the newer RunLambdaTask. This solution is less abrasive than simply removing the legacy mechanism as there are likely customers who will not want to be forced to migrate.

Other

<!-- e.g. detailed explanation, stacktraces, related issues, suggestions on how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc -->

  • [x] :wave: I may be able to implement this feature request
  • [ ] :warning: This feature might incur a breaking change

This is a :rocket: Feature Request

aws/aws-cdk

Answer questions eikeon

The output of the Lambda is what's in the Payload I'm seeing in the Step Functions console under the TaskSucceeded event. Before the following event ExecutionFailed shows the above invalid path. I have both a outputPath: '$.Payload', and a resultPath: '$.GetObjectResult' if that matters? I can open a new issue in the morning if this is a bug, can't see what I'm doing wrong at this point. But it's the end of a long day.

{
  "resourceType": "lambda",
  "resource": "invoke",
  "output": {
    "ExecutedVersion": "$LATEST",
    "Payload": {
      "Done": true,
      "Next": null,
      "BitsFetched": 0
    },
    "SdkHttpMetadata": {
      "HttpHeaders": {
        "Connection": "keep-alive",
        "Content-Length": "41",
        "Content-Type": "application/json",
        "Date": "Thu, 30 Apr 2020 00:39:33 GMT",
        "X-Amz-Executed-Version": "$LATEST",
        "x-amzn-Remapped-Content-Length": "0",
        "x-amzn-RequestId": "dc8e5c92-28b4-41fd-a7bf-90970b93f51a",
        "X-Amzn-Trace-Id": "root=1-5eaa1e45-f6d040f0e5b2480a56f2dba4;sampled=0"
      },
      "HttpStatusCode": 200
    },
    "SdkResponseMetadata": {
      "RequestId": "dc8e5c92-28b4-41fd-a7bf-90970b93f51a"
    },
    "StatusCode": 200
  }
}
useful!

Related questions

Issues compiling CDK projects ("TS2300: Duplicate identifier 'IteratorResult'")
cli: cdk deploy issue hot 3
Subnet selection returns more than one per AZ hot 2
cli: synth fails if cdk.out does not exist hot 2
Default policy are getting creating even when Managed policy were created in the Role hot 1
Python dependency libraries are set to latest hot 1
using json instead of a string as context in cdk.json hot 1
Attaching Managed Policy to Role failing hot 1
Access denied when adding an event notification to an existing s3 bucket hot 1
Unable to create CfnSpotFleet using Python hot 1
DBClusterParameterGroup not found: default.aurora5.6 hot 1
aws-ecs: Cannot deploy fargate services with ECR images hot 1
ecs_patterns.ApplicationLoadBalancedFargateService should allow specifying healthCheck path - aws-cdk hot 1
CodeCommitSourceAction tries to add a policy to an imported role hot 1
Using getAtt that returns a list within a string that is joined in the generated template throws an error hot 1
Github User Rank List