如何在Cloudformation中为AWS::Lambda::权限赋予多个SourceArn ? &



我已经更新了模板。如下所示,我需要为一个lambda函数授予多个调度器权限。

## 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

下面出现错误。

Value of property SourceArn must be of type String

如果你检查aws docs的SourceArn,你会看到这是一个字符串,而不是字符串列表。因此在SourceArn中只能有一个值。

最新更新