【发布时间】:2021-10-25 20:55:21
【问题描述】:
谁能帮我找出问题所在?
我正在我的无服务器 yml 中导入此 cloudformation 资源。 这是我的函数配置:
Resources:
eventHandler:
Type: AWS::Serverless::Function
Properties:
CodeUri: eventLambda/
Handler: dist/app.eventHandler
Runtime: nodejs12.x
FunctionName: eventHandler
这是我引用它的地方:
eventSourceRule:
Type: 'AWS::Events::Rule'
Properties:
Name: eventSourceRule
EventBusName: omnibus-${self:custom.stage}
EventPattern: |
{
"source": ["op.api"]
}
RetryPolicy:
MaximumRetryAttempts: 5
MaximumEventAgeInSeconds: 900
DeadLetterConfig:
Type: SQS
QueueLogicalId: EBRuleDLQ
Targets:
- Arn:
Fn::GetAtt:
- 'EventHandlerLambdaFunction'
- 'Arn'
Id: 'eventSourceRule'
请注意,我已经尝试过eventHandler 和EventHandler,但这些都不起作用。
这就是我收到的错误:
The CloudFormation template is invalid: Template error: instance of Fn::GetAtt references undefined resource EventHandlerLambdaFunction
【问题讨论】:
标签: amazon-web-services resources amazon-cloudformation serverless