终止支持通知: AWS 将于 2026 年 10 月 30 日终止对亚马逊 Pinpoint 的支持。2026 年 10 月 30 日之后,您将无法再访问亚马逊 Pinpoint 控制台或亚马逊 Pinpoint 资源(终端节点、区段、活动、旅程和分析)。有关更多信息,请参阅 Amazon Pinpoint 终止支持。注意: APIs 与短信相关、语音、移动推送、OTP 和电话号码验证不受此更改的影响,并受 AWS 最终用户消息的支持。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
有关查询 Amazon Pinpoint 分析数据的 IAM 策略
通过使用 Amazon Pinpoint API,您可以查询分析数据以获取标准指标子集,也称为适用于亚马逊 Pinpoint 项目、活动和旅程的关键绩效指标 (KPIs)。这些指标可以帮助您监控和评估项目、活动和旅程的绩效。
要管理对这些数据的访问权限,您可以创建 AWS Identity and Access Management (IAM) 策略,为有权访问这些数据的 IAM 角色或用户定义权限。为帮助精细控制对这些数据的访问,Amazon Pinpoint 提供了几种您可以在 IAM 策略中指定的不同操作。一种操作是在 Amazon Pinpoint 控制台上查看分析数据 (mobiletargeting:GetReports
),其他操作还包括使用 Amazon Pinpoint API 以编程方式访问分析数据等。
要创建管理分析数据访问权限的 IAM 策略,您可以使用 AWS Management Console AWS CLI、或 IAM API。请注意, AWS Management Console 上的可视化编辑器选项卡目前不包含查看或查询 Amazon Pinpoint 分析数据的操作。不过,您可以使用控制台上的 JSON 选项卡手动向 IAM 策略添加必要操作。
例如,以下政策允许以编程方式访问您在所有 AWS 地区的所有项目、活动和旅程的所有分析数据:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "QueryAllAnalytics", "Effect": "Allow", "Action": [ "mobiletargeting:GetApplicationDateRangeKpi", "mobiletargeting:GetCampaignDateRangeKpi", "mobiletargeting:GetJourneyDateRangeKpi", "mobiletargeting:GetJourneyExecutionMetrics", "mobiletargeting:GetJourneyExecutionActivityMetrics" ], "Resource": [ "arn:aws:mobiletargeting:*:
accountId
:apps/*/kpis/*", "arn:aws:mobiletargeting:*:accountId
:apps/*/campaigns/*/kpis/*", "arn:aws:mobiletargeting:*:accountId
:apps/*/journeys/*/kpis/*", "arn:aws:mobiletargeting:*:accountId
:apps/*/journeys/*/execution-metrics", "arn:aws:mobiletargeting:*:accountId
:apps/*/journeys/*/activities/*/execution-metrics" ] } ] }
您的 AWS 账户 ID 在accountId
哪里。
但作为最佳实践,您应创建遵循最低权限 原则的策略。换句话说,您应创建仅包含执行特定任务所需的权限的策略。为了支持这种做法并实现更精细的控制,您可以限制程序只能访问特定 AWS 区域中特定项目的分析数据,例如:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "QueryProjectAnalytics", "Effect": "Allow", "Action": [ "mobiletargeting:GetApplicationDateRangeKpi", "mobiletargeting:GetCampaignDateRangeKpi", "mobiletargeting:GetJourneyDateRangeKpi", "mobiletargeting:GetJourneyExecutionMetrics", "mobiletargeting:GetJourneyExecutionActivityMetrics" ], "Resource": [ "arn:aws:mobiletargeting:
region
:accountId
:apps/projectId
/kpis/*", "arn:aws:mobiletargeting:region
:accountId
:apps/projectId
/campaigns/*/kpis/*", "arn:aws:mobiletargeting:region
:accountId
:apps/projectId
/journeys/*/kpis/*", "arn:aws:mobiletargeting:region
:accountId
:apps/projectId
/journeys/*/execution-metrics", "arn:aws:mobiletargeting:region
:accountId
:apps/projectId
/journeys/*/activities/*/execution-metrics" ] } ] }
其中:
-
region
是托管该项目的 AWS 区域的名称。 -
accountId
是您的 AWS 账户 ID。 -
projectId
是您要提供访问权限的项目的标识符。
同样,以下策略示例仅允许编程访问特定活动的分析数据:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "QueryCampaignAnalytics", "Effect": "Allow", "Action": "mobiletargeting:GetCampaignDateRangeKpi", "Resource": "arn:aws:mobiletargeting:
region
:accountId
:apps/projectId
/campaigns/campaignId
/kpis/*" } ] }
其中:
-
region
是托管该项目的 AWS 区域的名称。 -
accountId
是你的 AWS 账户 身份证。 -
projectId
是与活动关联的项目的标识符。 -
campaignId
是您要提供访问权限的广告系列的标识符。
以下策略示例允许编程访问特定旅程和构成该旅程的活动的所有分析数据,包括参与度和执行数据:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "QueryJourneyAnalytics", "Effect": "Allow", "Action": [ "mobiletargeting:GetJourneyDateRangeKpi", "mobiletargeting:GetJourneyExecutionMetrics", "mobiletargeting:GetJourneyExecutionActivityMetrics" ], "Resource": [ "arn:aws:mobiletargeting:
region
:accountId
:apps/projectId
/journeys/journeyId
/kpis/*", "arn:aws:mobiletargeting:region
:accountId
:apps/projectId
/journeys/journeyId
/execution-metrics", "arn:aws:mobiletargeting:region
:accountId
:apps/projectId
/journeys/journeyId
/activities/*/execution-metrics" ] } ] }
其中:
-
region
是托管该项目的 AWS 区域的名称。 -
accountId
是您的 AWS 账户 ID。 -
projectId
是与旅程关联的项目的标识符。 -
journeyId
是您要提供访问权限的旅程的标识符。
有关您可以在 IAM 策略中使用的 Amazon Pinpoint API 操作的完整列表,请参阅用于 IAM 策略的 Amazon Pinpoint 操作。有关创建和管理 IAM 策略的详细信息,请参阅 IAM 用户指南。