-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws_stepfunction_tasks: missing lambda:InvokeFunction action #32349
Comments
@smg-kayle @smg-kayle Good afternoon. Thanks for opening the issue. Using the below bare minimal code: import * as cdk from 'aws-cdk-lib';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions';
import * as stepfunctiontasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
export class CdktestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const waitTime = cdk.Duration.minutes(5);
const wait = new stepfunctions.Wait(scope, "WaitDispatch", {
time: stepfunctions.WaitTime.duration(waitTime),
});
const lambdaFunction = new lambda.Function(this, 'TestLambdaFunction', {
code: new lambda.InlineCode(
"exports.handler = async (event) => console.log(event)"
),
runtime: lambda.Runtime.NODEJS_18_X, // lambda.Runtime.NODEJS_22_X
handler: "index.handler"
});
const invokeDispatcher = new stepfunctiontasks.LambdaInvoke(this, 'LambdaInvokeStepFunctionsTask', {
lambdaFunction: lambdaFunction,
outputPath: '$.Payload',
retryOnServiceExceptions: true,
});
const definition = wait.next(invokeDispatcher);
new stepfunctions.StateMachine(this, "InspectionMachine", {
definition
});
}
} Running
I see Could you share minimal end-to-end code to reproduce the issue? Are you using custom role in your code? Thanks, |
Dear @ashishdhingra, Your code and explanation looks obvious. In my use case, I use the definition with the const taskQualifyLead = new aws_stepfunctions_tasks.LambdaInvoke(this, 'Qualify Lead', {
lambdaFunction: this.leadQualifyLambda,
outputPath: '$.Payload',
retryOnServiceExceptions: true,
});
const taskLeadDistributionToProxyService = new aws_stepfunctions_tasks.LambdaInvoke(
this,
'Distribute Lead To lead-proxy-service',
{
lambdaFunction: this.leadDistributeToProxyService,
inputPath: '$.Payload',
retryOnServiceExceptions: true,
},
).addRetry({ interval: Duration.seconds(10) });
const taskUpdateValidLead = new aws_stepfunctions_tasks.LambdaInvoke(
this,
'Update Lead Status For Valid Data',
{
lambdaFunction: this.updateLeadLambda,
inputPath: '$.lead',
retryOnServiceExceptions: true,
},
);
const taskUpdateInvalidLead = new aws_stepfunctions_tasks.LambdaInvoke(
this,
'Update Lead Status For Invalid Data',
{
lambdaFunction: this.updateLeadLambda,
inputPath: '$.lead',
retryOnServiceExceptions: true,
},
);
const definitionOfLeadDistributionTasks = taskQualifyLead.next(
new aws_stepfunctions.Choice(this, 'Is Qualify Lead?')
.when(
aws_stepfunctions.Condition.booleanEquals('$.isValidLead', true),
taskUpdateValidLead.next(taskLeadDistributionToProxyService),
)
.otherwise(taskUpdateInvalidLead),
);
new LambdaToStepfunctions(this, 'LeadDistributionStateMachine', {
existingLambdaObj: this.leadDistributionLambda,
stateMachineProps: {
definition: definitionOfLeadDistributionTasks,
stateMachineType: aws_stepfunctions.StateMachineType.EXPRESS,
tracingEnabled: true,
},
logGroupProps: {
removalPolicy: RemovalPolicy.DESTROY,
},
createCloudWatchAlarms: true,
}); Could the issue be with the version mismatch? |
@ashishdhingra, Indeed, the issue is with version mismatch between |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
When upgrading to v2.168.0 to have NodeJS v22.x supported I notice that the
lambda:InvokeFunction
action is missing and still missing in v2.171.1.cdk diff command gives me this
Regression Issue
Last Known Working CDK Version
2.122.0
Expected Behavior
The StateMachine is able to invoke the lambda function
Current Behavior
The StateMachine is unable to invoke the lambda function
Reproduction Steps
Implementation details
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.168.0
Framework Version
No response
Node.js Version
18, 20
OS
Linux
Language
TypeScript
Language Version
5.7.2
Other information
No response
The text was updated successfully, but these errors were encountered: