简体   繁体   English

是否可以让AWS CloudWatch Alarm将通知发送到另一个区域的SNS主题?

[英]Is it possible to have AWS CloudWatch Alarm send a notification to an SNS topic in another region?

I am trying to create CloudWatch alarms in N. California region because that is where my EC2s are. 我试图在北加利福尼亚州创建CloudWatch警报,因为这是我的EC2所在的位置。

I want to send a notification to an SNS topic that supports both email and SMS, which n. 我想向同时支持电子邮件和SMS的SNS主题发送通知。 california does not, so I created an SNS topic in Oregon instead which supports both. 加利福尼亚州不这样做,因此我在俄勒冈州创建了一个SNS主题,该主题同时支持两者。

The topic does not appear in the "Send Notification To:" dropdown, reading online it seems like i'm supposed to be able to click 'enter list' and put in an ARN from another region, however when I do this I get an error saying: 该主题未出现在“发送通知至:”下拉列表中,在线阅读似乎应该可以单击“输入列表”并放入另一个区域的ARN,但是当我这样做时,我得到了一个提示。错误说:

Error:
There was an error saving the alarm. Please try again.

Cross region SNS will not be available to be configured for CloudWatch alarm notifications. 跨区域SNS将不可用于CloudWatch警报通知进行配置。

Alternatively, the following steps will help you achieve the same though not a fancy way of doing. 另外,以下步骤将帮助您实现相同但不是花哨的方式。

  1. Configure a SNS in the same region and configure CloudWatch to send alarm notifications to this SNS in the same region 在相同区域中配置SNS,并配置CloudWatch将警报通知发送到相同区域中的此SNS
  2. Subscribe a Lambda as a consumer for this SNS to listen and process the events sent from CloudWatch 订阅Lambda作为此SNS的使用者,以监听和处理从CloudWatch发送的事件
  3. The Lambda will reside in the same region which will receive the event from local SNS and publish (literally forward) the message (using SNS publish method) to the SNS in a different region. Lambda将驻留在同一区域中,该区域将从本地SNS接收事件,并将消息(使用SNS发布方法)发布(字面转发)到不同区域中的SNS。
  4. The SNS in other region can have SMS and/or email subscriptions. 其他区域的SNS可以订阅SMS和/或电子邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM