interface SfnStateMachineProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Events.Targets.SfnStateMachineProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#SfnStateMachineProps |
![]() | software.amazon.awscdk.services.events.targets.SfnStateMachineProps |
![]() | aws_cdk.aws_events_targets.SfnStateMachineProps |
![]() | aws-cdk-lib » aws_events_targets » SfnStateMachineProps |
Customize the Step Functions State Machine target.
Example
import * as iam from 'aws-cdk-lib/aws-iam';
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
const rule = new events.Rule(this, 'Rule', {
schedule: events.Schedule.rate(Duration.minutes(1)),
});
const dlq = new sqs.Queue(this, 'DeadLetterQueue');
const role = new iam.Role(this, 'Role', {
assumedBy: new iam.ServicePrincipal('events.amazonaws.com'),
});
const stateMachine = new sfn.StateMachine(this, 'SM', {
definition: new sfn.Wait(this, 'Hello', { time: sfn.WaitTime.duration(Duration.seconds(10)) })
});
rule.addTarget(new targets.SfnStateMachine(stateMachine, {
input: events.RuleTargetInput.fromObject({ SomeParam: 'SomeValue' }),
deadLetterQueue: dlq,
role: role
}));
Properties
Name | Type | Description |
---|---|---|
dead | IQueue | The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue. |
input? | Rule | The input to the state machine execution. |
max | Duration | The maximum age of a request that Lambda sends to a function for processing. |
retry | number | The maximum number of times to retry when the function returns an error. |
role? | IRole | The IAM role to be assumed to execute the State Machine. |
deadLetterQueue?
Type:
IQueue
(optional, default: no dead-letter queue)
The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.
The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
input?
Type:
Rule
(optional, default: the entire EventBridge event)
The input to the state machine execution.
maxEventAge?
Type:
Duration
(optional, default: Duration.hours(24))
The maximum age of a request that Lambda sends to a function for processing.
Minimum value of 60. Maximum value of 86400.
retryAttempts?
Type:
number
(optional, default: 185)
The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.
role?
Type:
IRole
(optional, default: a new role will be created)
The IAM role to be assumed to execute the State Machine.