LambdaInvokeProps Struct
Properties for invoking a Lambda function with LambdaInvoke.
Example
declare const fn: lambda.Function;
new tasks.LambdaInvoke(this, 'Invoke with empty object as payload', {
lambdaFunction: fn,
payload: sfn.TaskInput.fromObject({}),
});
// use the output of fn as input
new tasks.LambdaInvoke(this, 'Invoke with payload field in the state input', {
lambdaFunction: fn,
payload: sfn.TaskInput.fromJsonPathAt('$.Payload'),
});
Properties
assignoptional{ [key: string]: any }assignoptionaltyping.Mapping[str, Any]assignoptionalMap<String, Object>AssignoptionalIDictionary<string, object>Assignoptional*map[string]interface{}#Default: Not assign variables
Using workflow variables, you can store data in a step and retrieve that data in future steps.
clientContextoptionalstringclient_contextoptionalstrclientContextoptionalStringClientContextoptionalstringClientContextoptional*string#Default: No context
commentoptionalstringcommentoptionalstrcommentoptionalStringCommentoptionalstringCommentoptional*string#Default: No comment
credentialsoptionalCredentialscredentialsoptionalCredentialscredentialsoptionalCredentialsCredentialsoptionalCredentialsCredentialsoptionalCredentials#Default: None (Task is executed using the State Machine's execution role)
This enables cross-account resource invocations.
heartbeatoptionalDurationheartbeatoptionalDurationheartbeatoptionalDurationHeartbeatoptionalDurationHeartbeatoptionalDuration= Nonedeprecated#heartbeatTimeoutoptionalTimeoutheartbeat_timeoutoptionalTimeoutheartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeout= None#[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
inputPathoptionalstringinput_pathoptionalstrinputPathoptionalStringInputPathoptionalstringInputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
integrationPatternoptionalIntegrationPatternintegration_patternoptionalIntegrationPatternintegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPattern#Default: IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.
You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
invocationTypeoptionalLambdaInvocationTypeinvocation_typeoptionalLambdaInvocationTypeinvocationTypeoptionalLambdaInvocationTypeInvocationTypeoptionalLambdaInvocationTypeInvocationTypeoptionalLambdaInvocationType= InvocationType.REQUEST_RESPONSE#lambdaFunctionIFunctionlambda_functionIFunctionlambdaFunctionIFunctionLambdaFunctionIFunctionLambdaFunctionIFunctionrequired#outputPathoptionalstringoutput_pathoptionalstroutputPathoptionalStringOutputPathoptionalstringOutputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
outputsoptionalanyoutputsoptionalAnyoutputsoptionalObjectOutputsoptionalobjectOutputsoptionalinterface{}#Default: $states.result or $states.errorOutput
notes
When specified, the value overrides the state output default. The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters. Output also accepts a JSONata expression directly.
payloadoptionalTaskInputpayloadoptionalTaskInputpayloadoptionalTaskInputPayloadoptionalTaskInputPayloadoptionalTaskInput#Default: The state input (JSONata: '{%
payloadResponseOnlyoptionalbooleanpayload_response_onlyoptionalboolpayloadResponseOnlyoptionalBooleanPayloadResponseOnlyoptionalboolPayloadResponseOnlyoptional*bool= false#The payloadResponseOnly property cannot be used if integrationPattern, invocationType, clientContext, or qualifier are specified. It always uses the REQUEST_RESPONSE behavior.
qualifieroptionalstringqualifieroptionalstrqualifieroptionalStringQualifieroptionalstringQualifieroptional*stringdeprecated#Default: Version or alias inherent to the lambdaFunction object.
You only need to supply this if you want the version of the Lambda Function to depend on data in the state machine state. If not, you can pass the appropriate Alias or Version object directly as the lambdaFunction argument.
queryLanguageoptionalQueryLanguagequery_languageoptionalQueryLanguagequeryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguage= JSONPath#If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.
resultPathoptionalstringresult_pathoptionalstrresultPathoptionalStringResultPathoptionalstringResultPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
resultSelectoroptional{ [key: string]: any }result_selectoroptionaltyping.Mapping[str, Any]resultSelectoroptionalMap<String, Object>ResultSelectoroptionalIDictionary<string, object>ResultSelectoroptional*map[string]interface{}= None#You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.
retryOnServiceExceptionsoptionalbooleanretry_on_service_exceptionsoptionalboolretryOnServiceExceptionsoptionalBooleanRetryOnServiceExceptionsoptionalboolRetryOnServiceExceptionsoptional*bool= true#This handles Lambda.ServiceException, Lambda.AWSLambdaException, Lambda.SdkClientException, and Lambda.ClientExecutionTimeoutException with an interval of 2 seconds, a back-off rate of 2 and 6 maximum attempts.
stateNameoptionalstringstate_nameoptionalstrstateNameoptionalStringStateNameoptionalstringStateNameoptional*string#Default: The construct ID will be used as state name