Hi, I am trying to create a Simple AWS EventBridge on a Lambda Function, both of which are being created using Serverless Script.
Here is the code I am trying to use in serverless.yml (Some variables are unset) also handler.js is default
service: event-bridge-cloudformation
provider:
name: aws
runtime: nodejs10.x
region: us-east-1
functions:
hello:
handler: handler.hello
resources:
Resources:
ScheduledRule:
Type: AWS::Events::Rule
Properties:
Description: "ScheduledRule"
ScheduleExpression: "rate(1 minutes)"
State: "ENABLED"
Targets:
-
Arn:
Fn::GetAtt:
- "arn:aws:lambda:${self:provider.region}:${self:provider.environment.AWS_ACCOUNT}:function:${self:service}-${self:provider.stage}-hello"
- "Arn"
Above code is giving me following error:
Error: The CloudFormation template is invalid: Template error: instance of Fn::GetAtt references undefined resource
Can you please help me with some basic template in serverless that creates both lambda and an EventBridge on that Lambda
Thanks.