【问题标题】:Sending message to AWS Lambda from AWS Pinpoint Custom Channel从 AWS Pinpoint 自定义通道向 AWS Lambda 发送消息
【发布时间】:2020-12-18 05:12:21
【问题描述】:

我正在尝试通过自定义通道从 AWS Pinpoint 向我的 AWS Lambda 函数发送消息,如 here 所述

我的问题是关于授予 AWS Pinpoint 调用我的 lambda 函数的权限。文档中提供的用于授予权限的 AWS CLI 命令不起作用。当我按照文档中的描述从 AWS CLI 执行 aws lambda add-permission 命令时,出现以下错误:

no matches found: arn:aws:mobiletargeting:us-east-1:<account-id>:apps/*

如果我将 ARN 更改为以下任何一项,结果不会改变:

  • arn:aws:mobiletargeting:us-east-1:<account-id>:apps/<pinpoint-app-id>/*
  • arn:aws:mobiletargeting:us-east-1:<account-id>:apps/<pinpoint-app-id>/campaigns/*
  • arn:aws:mobiletargeting:us-east-1:<account-id>:/apps/<pinpoint-app-id>/*
  • arn:aws:mobiletargeting:us-east-1:<account-id>:/apps/<pinpoint-app-id>/campaigns/*

我尝试使用 AWS Cloudformation 而不是 AWS CLI,我成功地授予 AWS Pinpoint 调用我的 lambda 函数的权限。至少基于资源的策略出现在我的 AWS Lambda 函数控制台的“权限”选项卡中。源 ARN 类似条件是 arn:aws:mobiletargeting:us-east-1:<account-id>:apps/<pinpoint-app-id>/*

但是,当我尝试在同一个 pinpoint 应用程序(即项目)下创建活动时,我收到以下错误消息:

"Amazon Pinpoint couldn’t invoke the Lambda function that you specified for custom delivery. Verify that a function policy is assigned to the function and that Amazon Pinpoint is authorized to invoke the function."

我尝试了不同的类似 SourceArn 的条件,包括以下,但结果是一样的:

  • arn:aws:mobiletargeting:us-east-1:<account-id>:apps/<pinpoint-app-id>/*
  • arn:aws:mobiletargeting:us-east-1:<account-id>:apps/<pinpoint-app-id>/campaigns/*
  • arn:aws:mobiletargeting:us-east-1:<account-id>:apps/*
  • arn:aws:mobiletargeting:us-east-1:<account-id>:*
  • arn:aws:mobiletargeting:us-east-1:<account-id>:/apps/*

无法找出问题所在。任何关于我缺少什么的想法将不胜感激。

提前致谢!

【问题讨论】:

    标签: amazon-web-services aws-lambda aws-pinpoint


    【解决方案1】:

    有趣但返回no matches found: arn:aws:mobiletargeting:us-east-1:<account-id>:apps/* 的相同aws lambda add-permission 命令在sudo su 之后工作。

    【讨论】:

      【解决方案2】:

      这可能为时已晚,但对于有类似问题并且至少暂时不想浏览整个 cloudformation 模板的任何人来说。

      我遇到了同样的问题

      “未找到匹配项:arn:aws:mobiletargeting:us-east-1::apps/*”。

      这是由于我的终端在使用 '*' 时表现异常,因此在 arn 周围添加单引号是可行的,例如:
      arn:aws:mobiletargeting:us-east-1:<account-id>:apps/<pinpoint-app-id>/*

      【讨论】:

      • 抱歉格式难以阅读,stackoverflow 发布的新手。
      猜你喜欢
      • 1970-01-01
      • 2016-12-25
      • 2022-01-25
      • 2017-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多