Is it possible to create a scheduled rule from CloudWatch for a set of lambda state functions
I want to use CloudFormation to create a stack of pre-existing lambda functions in a state machine using step functions in a timetable (30 minutes). I have successfully created a stack for other methods.
Basically I need help or guidance on how to create a scheduled event in CloudFormation for step functions . Here's what I tried:
"NOTDScheduler": {
"Type": "AWS::Events::Rule",
"Properties": {
"Description": "Schedules a NOTD every 30 minutes",
"ScheduleExpression": "rate(30 minutes)",
"State": "ENABLED",
"Targets": [
{
"Arn": "${statemachineARN}",
"statemachineARN": {
"Fn::GetAtt": [
"NOTDStateMachine",
"Arn"
]
},
"Id": "NOTDScheduleTarget"
}
]
},
But I keep getting errors like
[Error] / Resources / NOTDScheduler / Properties / Targets / 0 / statemachineARN / Fn :: GetAtt: The AWS :: StepFunctions :: StateMachine resource type does not support the {Arn} attribute.
and have no idea how Arn is not a supported attribute. Is there a workaround?
source to share
To get the ARN of a resource AWS::StepFunctions::StateMachine
, you need to call !Ref NOTDStateMachine
instead!GetAtt NOTDStateMachine.Arn
Check it Return Values
here: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html
source to share