英文:
How to give multiple SourceArn for AWS::Lambda::Permission in Cloudformation?
问题
I have updated the template.yaml file as below, I need to give permission to multiple schedulers for a lambda function.
## Grant permission to Events trigger Lambda
PermissionForEventsToInvokeSchedulerFunction:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref SchedulerFunction
Action: lambda:InvokeFunction
Principal: events.amazonaws.com
SourceArn:
- !GetAtt AsyncDashboardFirstDayMonthScheduledRule.Arn
- !GetAtt AsyncDashboardOnceEveryDayScheduledRule.Arn
- !GetAtt AsyncDashboardOnceEveryOnehourScheduledRule.Arn
Getting error below.
Value of property SourceArn must be of type String.
英文:
I have updated the template.yaml file as below, I need to give permission to multiple schedulers for an lambda function.
## Grant permission to Events trigger Lambda
PermissionForEventsToInvokeSchedulerFunction:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref SchedulerFunction
Action: lambda:InvokeFunction
Principal: events.amazonaws.com
SourceArn:
- !GetAtt AsyncDashboardFirstDayMonthScheduledRule.Arn
- !GetAtt AsyncDashboardOnceEveryDayScheduledRule.Arn
- !GetAtt AsyncDashboardOnceEveryOnehourScheduledRule.Arn
Getting error below.
Value of property SourceArn must be of type String
答案1
得分: 2
如果您查看AWS文档的SourceArn,您会发现这是一个字符串,而不是一个字符串列表。因此,您只能在SourceArn
中有一个值。
英文:
If you check aws docs's SourceArn you will see that this is a string, not a list of strings. So you can have only one value in SourceArn
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论