教學課程:設定 Amazon SNS 主題 - Amazon GameLift

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

教學課程:設定 Amazon SNS 主題

您可以讓 Amazon GameLift 將 FlexMatch 配對建構器產生的所有事件發佈至 Amazon SNS 主題。

為 Amazon GameLift 事件通知建立 SNS 主題
  1. 開啟 Amazon SNS 主控台

  2. 在導覽窗格中,選擇 Topics (主題)。

  3. Topics (主題) 頁面上,選擇 Create topic (建立主題)。

  4. 在 主控台中建立主題。如需詳細資訊,請參閱《Amazon Simple Notification Service 開發人員指南》中的如何使用 建立主題 AWS Management Console

  5. 在主題的詳細資訊頁面上,選擇編輯

  6. (選用) 在主題的編輯頁面上,展開存取政策,然後從下列 AWS Identity and Access Management (IAM) 政策陳述式將粗體語法新增至現有政策的結尾。(為了清楚起見,此處會顯示整個政策。) 請務必將 Amazon Resource Name (ARN) 詳細資訊用於您自己的 SNS 主題和 Amazon GameLift 配對組態。

    { "Version": "2008-10-17", "Id": "__default_policy_ID", "Statement": [ { "Sid": "__default_statement_ID", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": [ "SNS:GetTopicAttributes", "SNS:SetTopicAttributes", "SNS:AddPermission", "SNS:RemovePermission", "SNS:DeleteTopic", "SNS:Subscribe", "SNS:ListSubscriptionsByTopic", "SNS:Publish" ], "Resource": "arn:aws:sns:your_region:your_account:your_topic_name", "Condition": { "StringEquals": { "AWS:SourceAccount": "your_account" } } }, { "Sid": "__console_pub_0", "Effect": "Allow", "Principal": { "Service": "gamelift.amazonaws.com" }, "Action": "SNS:Publish", "Resource": "arn:aws:sns:your_region:your_account:your_topic_name", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:gamelift:your_region:your_account:matchmakingconfiguration/your_configuration_name" } } } ] }
  7. 選擇 Save changes (儲存變更)。