本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
教學課程:設定 Amazon SNS 主題
您可以讓 Amazon GameLift Servers 將FlexMatch配對建構器產生的所有事件發佈至 Amazon SNS 主題。
建立Amazon GameLift Servers事件通知的 SNS 主題
-
開啟 Amazon SNS 主控台。
-
在導覽窗格中,選擇 Topics (主題)。
-
在 Topics (主題) 頁面上,選擇 Create topic (建立主題)。
-
在 主控台中建立主題。如需詳細資訊,請參閱《Amazon Simple Notification Service 開發人員指南》中的使用 建立主題 AWS Management Console。
-
在主題的詳細資訊頁面上,選擇編輯。
-
(選用) 在主題的編輯頁面上,展開存取政策,然後從下列 AWS Identity and Access Management (IAM) 政策陳述式將粗體語法新增至現有政策的結尾。(為了清楚起見,此處會顯示整個政策。) 請務必將 Amazon Resource Name (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
"
}
}
}
]
}
-
選擇儲存變更。