翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
Amazon Pinpoint 分析データのクエリ実行用の IAM ポリシー
Amazon Pinpoint API を使用して、標準メトリクスのサブセットの分析データをクエリできます。重要業績評価指標標 (KPI) Amazon Pinpoint プロジェクト、キャンペーン、およびジャーニーに適用されます。標準メトリクスは、プロジェクト、キャンペーン、およびジャーニーのパフォーマンスを監視および評価する際に役立ちます。
このデータへのアクセスを管理するには、データへのアクセスが許可されている IAM ロールまたはユーザーのアクセス許可を定義する AWS Identity and Access Management (IAM) ポリシーを作成できます。データアクセス時の管理をきめ細かくサポートできるように、Amazon Pinpoint には、IAM ポリシーで指定できる個別のアクションが提供されています。Amazon Pinpoint コンソールで分析データを表示するための特定のアクションが Amazon Pinpoint コンソール (mobiletargeting:GetReports
) に提供されています。Amazon Pinpoint API を使用して、プログラムにより分析データにアクセスするためのアクションも提供されています。
分析データへのアクセスを管理する IAM ポリシーを作成するには、、 AWS CLI、または AWS Management Console IAM API を使用できます。なお、 AWS Management Console の [Visual editor] タブには、現在 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" ] } ] }
accountId
は AWS アカウント ID です。
ただしベストプラクティスとして、最小特権の原則に準拠したポリシーを作成してください。別の言い方をすると、特定タスクの実行にのみ必要とされる権限のみが含まれたポリシーを作成してください。このプラクティスをサポートし、より詳細なコントロールを実装するために、特定の 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 アカウント ID です。 -
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 ユーザーガイド』をご参照ください。