aws-events-rule-step-function - AWS Solutions Constructs


All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.

Language Package

This AWS Solutions Constructs pattern implements an AWS Events rule and an AWS Step function.

Here is a minimal deployable pattern definition:

const { EventsRuleToStepFunction, EventsRuleToStepFunctionProps } = require('@aws-solutions-constructs/aws-events-rule-step-function'); const startState = new stepfunctions.Pass(stack, 'StartState'); const props: EventsRuleToStepFunctionProps = { stateMachineProps: { definition: startState }, eventRuleProps: { schedule: events.Schedule.rate(Duration.minutes(5)) } }; new EventsRuleToStepFunction(stack, 'test-events-rule-step-function-stack', props);


new EventsRuleToStepFunction(scope: Construct, id: string, props: EventsRuleToStepFunctionProps);


Pattern Construct Props

Name Type Description
stateMachineProps sfn.StateMachineProps Optional user provided props to override the default props for sfn.StateMachine
eventRuleProps events.RuleProps User provided eventRuleProps to override the defaults

Pattern Properties

Name Type Description
cloudwatchAlarms cloudwatch.Alarm[] Returns a list of one or more CloudWatch alarms created by the pattern.
eventsRule events.Rule Returns an instance of the Events rule created by the pattern.
stateMachine sfn.StateMachine Returns an instance of the state machine created by the pattern.
stateMachineLogGroup logs.LogGroup Returns an instance of the log group created by the pattern for the state machine.

Default settings

Out-of-the-box implementation of this pattern without any overrides will set the following defaults:

Amazon CloudWatch Events Rule

  • Grant least privilege permissions to CloudWatch Events to trigger the Lambda Function

AWS Step Function

  • Enable CloudWatch logging for API Gateway

  • Deploy best practices CloudWatch Alarms for the Step Function