简体   繁体   English

使用Cloudformation AWS将SNS主题添加到现有CloudWatch Alarm

[英]Add SNS topic to existing CloudWatch Alarm with Cloudformation AWS

I have a separate cloudformation template which creates cloud watch alarms for resources. 我有一个单独的cloudformation模板,该模板可为资源创建云监视警报。

I am creating another cloudformation template for some specific purposes. 我正在出于某些特定目的创建另一个cloudformation模板。 The sub task involves to add SNS topic to existing cloudwatch alarm created by separate template. 子任务涉及将SNS主题添加到由单独模板创建的现有cloudwatch警报中。

Is it possible with cloudformation template? cloudformation模板可以吗?

PS I know we can edit cloudwatch alarm manually through AWS console OR we can use PutAlarm action to add topic. PS我知道我们可以通过AWS控制台手动编辑cloudwatch警报,也可以使用PutAlarm操作添加主题。 However I really want to achieve this with cloudformation template without any explicit actions. 但是,我真的很想使用cloudformation模板来实现此目标,而无需任何显式操作。

You can send information between templates by using Import/Export. 您可以使用“导入/导出”在模板之间发送信息。

So, your first template can export the ARN of the Alarm and the second template can import this value and reference it. 因此,您的第一个模板可以导出警报的ARN,而第二个模板可以导入此值并引用它。

See: Exporting Stack Output Values - AWS CloudFormation 请参阅: 导出堆栈输出值-AWS CloudFormation

However, I doubt you can add another Notification type to an existing alarm, since this is part of the Alarm definition itself. 但是,我怀疑您可以向现有警报中添加其他通知类型,因为这是警报定义本身的一部分。

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

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