简体   繁体   中英

Add SNS topic to existing CloudWatch Alarm with Cloudformation AWS

I have a separate cloudformation template which creates cloud watch alarms for resources.

I am creating another cloudformation template for some specific purposes. The sub task involves to add SNS topic to existing cloudwatch alarm created by separate template.

Is it possible with cloudformation template?

PS I know we can edit cloudwatch alarm manually through AWS console OR we can use PutAlarm action to add topic. However I really want to achieve this with cloudformation template without any explicit actions.

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.

See: Exporting Stack Output Values - AWS CloudFormation

However, I doubt you can add another Notification type to an existing alarm, since this is part of the Alarm definition itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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