教程:设置 Amazon SNS 主题 - Amazon GameLift Servers

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

教程:设置 Amazon SNS 主题

您可以将FlexMatch媒人生成的所有事件Amazon GameLift Servers发布到Amazon SNS主题中。

为Amazon GameLift Servers事件通知创建 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) 策略声明中的粗体语法添加到现有策略的末尾。(为清晰起见显示了整个策略。) 请务必将亚马逊资源名称 (ARN) 详细信息用于您自己的 SNS 主题和Amazon GameLift Servers配对配置。

    JSON
    { "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:us-east-1:111122223333:your_topic_name", "Condition": { "StringEquals": { "AWS:SourceAccount": "111122223333" } } }, { "Sid": "__console_pub_0", "Effect": "Allow", "Principal": { "Service": "gamelift.amazonaws.com" }, "Action": "SNS:Publish", "Resource": "arn:aws:sns:us-east-1:111122223333:your_topic_name", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:gamelift:us-east-1:111122223333:matchmakingconfiguration/your_configuration_name" } } } ] }
  7. 选择保存更改