

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

# 設定 Amazon SNS 將提醒訊息傳送至其他目的地
<a name="AMP-alertmanager-SNS-otherdestinations"></a>

Amazon Managed Service for Prometheus 只能將提醒訊息傳送至 Amazon Simple Notification Service (Amazon SNS)。若要將這些訊息傳送至其他目的地，例如電子郵件、Webhook、Slack 或 OpsGenie，您必須設定 Amazon SNS 將訊息轉送到這些端點。

下列各節說明設定 Amazon SNS 將警示轉送至其他目的地。

**Topics**
+ [Email](#AMP-alertmanager-SNS-otherdestinations-email)
+ [Webhook](#AMP-alertmanager-SNS-otherdestinations-webhook)
+ [Slack](#AMP-alertmanager-SNS-otherdestinations-Slack)
+ [OpsGenie](#AMP-alertmanager-SNS-otherdestinations-OpsGenie)

## Email
<a name="AMP-alertmanager-SNS-otherdestinations-email"></a>

若要設定 Amazon SNS 主題以將訊息輸出至電子郵件，請建立訂閱。在 Amazon SNS 主控台中，選擇「**訂閱**」索引標籤以開啟「**訂閱**」清單頁面。選擇**建立訂閱**，然後選取**電子郵件**。Amazon SNS 會將確認電子郵件傳送至所列出的電子郵件地址。接受確認後，您就能以電子郵件形式接收 Amazon SNS 通知，來自您訂閱的主題。如需詳細資訊，請參閱[訂閱 Amazon SNS 主題](https://docs.aws.amazon.com/sns/latest/dg/sns-create-subscribe-endpoint-to-topic.html)。

## Webhook
<a name="AMP-alertmanager-SNS-otherdestinations-webhook"></a>

若要設定 Amazon SNS 主題以將訊息輸出到 Webhook 端點，請建立訂閱。在 Amazon SNS 主控台中，選擇「**訂閱**」索引標籤以開啟「**訂閱**」清單頁面。選擇**建立訂閱**，然後選取 **HTTP/HTTPS**。建立訂閱之後，您必須遵循確認步驟來啟用訂閱。若為啟用中狀態，則 HTTP 端點則 HTTP 端點應收到 Amazon SNS 通知。如需詳細資訊，請參閱[訂閱 Amazon SNS 主題](https://docs.aws.amazon.com/sns/latest/dg/sns-create-subscribe-endpoint-to-topic.html)。如需有關使用 Slack webhooks 將訊息發佈至不同目的地的詳細資訊，請參閱[如何使用網路掛鉤將 Amazon SNS 訊息發佈到 Amazon Chime、Slack 或 Microsoft 團隊？](https://aws.amazon.com/premiumsupport/knowledge-center/sns-lambda-webhooks-chime-slack-teams/)

## Slack
<a name="AMP-alertmanager-SNS-otherdestinations-Slack"></a>

若要將 Amazon SNS 主題設定為將訊息輸出至 Slack，您有兩種選擇。您可與 Slack 的電子郵件至管道整合 (可讓 Slack 接受電子郵件訊息或將其轉送至 Slack 管道)，或您可使用 Lambda 函數將 Amazon SNS 通知重新寫入 Slack。如需轉送電子郵件至 Slack 頻道的詳細資訊，請參閱[確認 Slack Webhook 的 AWS SNS 主題訂閱](https://stackoverflow.com/questions/49341187/confirming-aws-sns-topic-subscription-for-slack-webhook)。如需有關建構 Lambda 函數以將 Amazon SNS 訊息轉換至 Slack 的詳細資訊，請參閱[如何將 Amazon Managed Service for Prometheus 與 Slack 整合](https://aws.amazon.com/blogs/mt/how-to-integrate-amazon-managed-service-for-prometheus-with-slack/)。

## OpsGenie
<a name="AMP-alertmanager-SNS-otherdestinations-OpsGenie"></a>

如需如何設定 Amazon SNS 主題以將訊息輸出至 OpsGenie 的相關資訊，請參閱[將選項與傳入的 Amazon SNS 整合](https://support.atlassian.com/opsgenie/docs/integrate-opsgenie-with-incoming-amazon-sns/)。