class SfnStateMachine
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Events.Targets.SfnStateMachine |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#SfnStateMachine |
![]() | software.amazon.awscdk.services.events.targets.SfnStateMachine |
![]() | aws_cdk.aws_events_targets.SfnStateMachine |
![]() | aws-cdk-lib » aws_events_targets » SfnStateMachine |
Implements
IRule
Use a StepFunctions state machine as a target for Amazon EventBridge rules.
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
}));
Initializer
new SfnStateMachine(machine: IStateMachine, props?: SfnStateMachineProps)
Parameters
- machine
IState
Machine - props
Sfn
State Machine Props
Properties
Name | Type | Description |
---|---|---|
machine | IState |
machine
Type:
IState
Methods
Name | Description |
---|---|
bind(_rule, _id?) | Returns a properties that are used in an Rule to trigger this State Machine. |
bind(_rule, _id?)
public bind(_rule: IRule, _id?: string): RuleTargetConfig
Parameters
- _rule
IRule
- _id
string
Returns
Returns a properties that are used in an Rule to trigger this State Machine.