

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

# 使用伺服器端加密設定 SNS 主題
<a name="queue-notification-sns-sse"></a>

您可以使用伺服器端加密 (SSE) 將敏感資料存放在加密主題中。SSE 使用在 AWS Key Management Service () 中管理的金鑰來保護 Amazon SNS 主題中的訊息內容AWS KMS。如需使用 Amazon SNS 進行伺服器端加密的詳細資訊，請參閱《*Amazon Simple Notification Service 開發人員指南*》中的[靜態加密](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html)。

若要使用伺服器端加密設定 SNS 主題，請檢閱下列主題：
+ 《 *AWS Key Management Service 開發人員指南*》中的[建立金鑰](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) 
+ 《*Amazon Simple Notification Service 開發人員指南*》中的[為主題啟用 SSE](https://docs.aws.amazon.com/sns/latest/dg/sns-enable-encryption-for-topic.html) 

建立 KMS 金鑰時，請使用下列 KMS 金鑰政策：

```
{ 
  "Effect": "Allow", 
  "Principal": { 
    "Service": "gamelift.amazonaws.com" 
  },
  "Action": [
      "kms:Decrypt",
      "kms:GenerateDataKey"
  ],
  "Resource": "*",
  "Condition": {
      "ArnLike": { 
        "aws:SourceArn": "arn:aws:gamelift:your_region:your_account:matchmakingconfiguration/your_configuration_name" 
      },
      "StringEquals": { 
        "kms:EncryptionContext:aws:sns:topicArn": "arn:aws:sns:your_region:your_account:your_sns_topic_name" 
      }
  }
}
```