将功能策略分配给lambda,该策略允许所有CloudWatch Events规则调用lambda?

时间:2019-05-17 09:44:54

标签: aws-lambda

我使用了上面的CLI命令,但控制台中出现错误,请找到错误的附件屏幕截图 enter image description here  请找到以下lambda的功能策略:

{   "Version": "2012-10-17",   "Id": "default",   "Statement": [
    {
       "Sid": "events-access",
       "Effect": "Allow",
       "Principal": {
        "Service": "events.amazonaws.com"
       },
       "Action": "lambda:InvokeFunction",
       "Resource": "arn:aws:lambda:us-east-1:096280016729:function:leto_debug_log",
       "Condition": {
         "ArnLike": {
           "AWS:SourceArn": "arn:aws:events:us-east-1:096280016729:rule/*"
         }
      }
     }   ] }

我遵循以下链接的回答,但仍然出现错误: Allow all cloudwatch event rules to have access to lambda function

1 个答案:

答案 0 :(得分:0)

也许这可能是因为CloudWatch Event规则名称*似乎无效。例如,如果您尝试在AWS lambda控制台区域中删除此规则,则会在触发器UI区域中收到如下错误:

enter image description here

以某种方式正式支持此方法会很好,但我认为并非如此。 idk