I'm unable to attach an EventBridge Schedule to a lambda function in AWS SAM.
Here is the section of my SAM template that intends to attach a schedule to the Lambda function:
TestLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: TestLambda
CodeUri: test_directory/
Handler: test_file.lambda_handler
Runtime: python3.8
Role: !Ref LambdaApiRole
Events:
TestLambdaCron:
Type: Schedule
Properties:
Schedule: rate(1 day)
This is the error I get while deploying the template:
Embedded stack <stack ARN> was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: The following resource(s) failed to create: [TestLambdaTestLambdaCron].
A solution would be much appreciated, thanks in advance!
PS: LambdaApiRole
is defined in the template and can be referenced in the function (working fine), it's when TestLambdaCron
is added when the issues occur
The AWS SAM CLI version I am working on is: SAM CLI, version 1.37.0