interface LambdaInvokeJsonPathProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.StepFunctions.Tasks.LambdaInvokeJsonPathProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#LambdaInvokeJsonPathProps |
![]() | software.amazon.awscdk.services.stepfunctions.tasks.LambdaInvokeJsonPathProps |
![]() | aws_cdk.aws_stepfunctions_tasks.LambdaInvokeJsonPathProps |
![]() | aws-cdk-lib » aws_stepfunctions_tasks » LambdaInvokeJsonPathProps |
Properties for invoking a Lambda function with LambdaInvoke using JsonPath.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_lambda as lambda } from 'aws-cdk-lib';
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';
declare const assign: any;
declare const function_: lambda.Function;
declare const resultSelector: any;
declare const taskInput: stepfunctions.TaskInput;
declare const taskRole: stepfunctions.TaskRole;
declare const timeout: stepfunctions.Timeout;
const lambdaInvokeJsonPathProps: stepfunctions_tasks.LambdaInvokeJsonPathProps = {
lambdaFunction: function_,
// the properties below are optional
assign: {
assignKey: assign,
},
clientContext: 'clientContext',
comment: 'comment',
credentials: {
role: taskRole,
},
heartbeat: cdk.Duration.minutes(30),
heartbeatTimeout: timeout,
inputPath: 'inputPath',
integrationPattern: stepfunctions.IntegrationPattern.REQUEST_RESPONSE,
invocationType: stepfunctions_tasks.LambdaInvocationType.REQUEST_RESPONSE,
outputPath: 'outputPath',
payload: taskInput,
payloadResponseOnly: false,
qualifier: 'qualifier',
queryLanguage: stepfunctions.QueryLanguage.JSON_PATH,
resultPath: 'resultPath',
resultSelector: {
resultSelectorKey: resultSelector,
},
retryOnServiceExceptions: false,
stateName: 'stateName',
taskTimeout: timeout,
timeout: cdk.Duration.minutes(30),
};
Properties
Name | Type | Description |
---|---|---|
lambda | IFunction | Lambda function to invoke. |
assign? | { [string]: any } | Workflow variables to store in this step. |
client | string | Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function. |
comment? | string | A comment describing this state. |
credentials? | Credentials | Credentials for an IAM Role that the State Machine assumes for executing the task. |
heartbeat? | Duration | Timeout for the heartbeat. |
heartbeat | Timeout | Timeout for the heartbeat. |
input | string | JSONPath expression to select part of the state to be the input to this state. |
integration | Integration | AWS Step Functions integrates with services directly in the Amazon States Language. |
invocation | Lambda | Invocation type of the Lambda function. |
output | string | JSONPath expression to select part of the state to be the output to this state. |
payload? | Task | The JSON that will be supplied as input to the Lambda function. |
payload | boolean | Invoke the Lambda in a way that only returns the payload response without additional metadata. |
qualifier? | string | Version or alias to invoke a published version of the function. |
query | Query | The name of the query language used by the state. |
result | string | JSONPath expression to indicate where to inject the state's output. |
result | { [string]: any } | The JSON that will replace the state's raw result and become the effective result before ResultPath is applied. |
retry | boolean | Whether to retry on Lambda service exceptions. |
state | string | Optional name for this state. |
task | Timeout | Timeout for the task. |
timeout? | Duration | Timeout for the task. |
lambdaFunction
Type:
IFunction
Lambda function to invoke.
assign?
Type:
{ [string]: any }
(optional, default: Not assign variables)
Workflow variables to store in this step.
Using workflow variables, you can store data in a step and retrieve that data in future steps.
See also: https://docs.aws.amazon.com/step-functions/latest/dg/workflow-variables.html
clientContext?
Type:
string
(optional, default: No context)
Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function.
comment?
Type:
string
(optional, default: No comment)
A comment describing this state.
credentials?
Type:
Credentials
(optional, default: None (Task is executed using the State Machine's execution role))
Credentials for an IAM Role that the State Machine assumes for executing the task.
This enables cross-account resource invocations.
heartbeat?
⚠️ Deprecated: use heartbeatTimeout
Type:
Duration
(optional, default: None)
Timeout for the heartbeat.
heartbeatTimeout?
Type:
Timeout
(optional, default: None)
Timeout for the heartbeat.
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
inputPath?
Type:
string
(optional, default: $)
JSONPath expression to select part of the state to be the input to this state.
May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
integrationPattern?
Type:
Integration
(optional, default: IntegrationPattern.REQUEST_RESPONSE
for most tasks.
IntegrationPattern.RUN_JOB
for the following exceptions:
BatchSubmitJob
, EmrAddStep
, EmrCreateCluster
, EmrTerminationCluster
, and EmrContainersStartJobRun
.)
AWS Step Functions integrates with services directly in the Amazon States Language.
You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
invocationType?
Type:
Lambda
(optional, default: InvocationType.REQUEST_RESPONSE)
Invocation type of the Lambda function.
outputPath?
Type:
string
(optional, default: $)
JSONPath expression to select part of the state to be the output to this state.
May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
payload?
Type:
Task
(optional, default: The state input (JSONata: '{% $states.input %}', JSONPath: '$'))
The JSON that will be supplied as input to the Lambda function.
payloadResponseOnly?
Type:
boolean
(optional, default: false)
Invoke the Lambda in a way that only returns the payload response without additional metadata.
The payloadResponseOnly
property cannot be used if integrationPattern
, invocationType
,
clientContext
, or qualifier
are specified.
It always uses the REQUEST_RESPONSE behavior.
qualifier?
⚠️ Deprecated: pass a Version or Alias object as lambdaFunction instead
Type:
string
(optional, default: Version or alias inherent to the lambdaFunction
object.)
Version or alias to invoke a published version of the function.
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.
queryLanguage?
Type:
Query
(optional, default: JSONPath)
The name of the query language used by the state.
If the state does not contain a queryLanguage
field,
then it will use the query language specified in the top-level queryLanguage
field.
resultPath?
Type:
string
(optional, default: $)
JSONPath expression to indicate where to inject the state's output.
May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
resultSelector?
Type:
{ [string]: any }
(optional, default: None)
The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.
You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.
retryOnServiceExceptions?
Type:
boolean
(optional, default: true)
Whether to retry on Lambda service exceptions.
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.
stateName?
Type:
string
(optional, default: The construct ID will be used as state name)
Optional name for this state.
taskTimeout?
Type:
Timeout
(optional, default: None)
Timeout for the task.
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
timeout?
⚠️ Deprecated: use taskTimeout
Type:
Duration
(optional, default: None)
Timeout for the task.