9

How to export existing, configured and tested AWS CloudWatch alarms to Cloudformation template?

I know about CloudFormer tool, but it supports limited number of AWS services (Amazon VPC, DynamoDB, etc) and don't supports some of services which we use. Which tools and approaches can I use in my case for generating Cloudformation template?

Hleb
  • 7,037
  • 12
  • 58
  • 117
  • 2
    You can use the CLI to describe your alarms; the format is json but it is a 90% match to the Cloudformation template. – George Rushby Jun 28 '19 at 09:44
  • @GeorgeRushby thank you, but my question is about how to export existing CW alarms, not describe them in the template manually. – Hleb Jul 04 '19 at 07:15

2 Answers2

3

You can do it for already existed alarm by the following steps:

  1. Go to the alarm definition in AWS console
  2. From Action (top right) menu select "View Source"
  3. In the bottom of popup dialog with alarm's sources select "CloudFormation YAML" or "CloudFormation JSON"
Dima Svider
  • 377
  • 2
  • 15
2

AWS have recently announced the ability to create a new CloudFormation stack using existing resources or update an existing CloudFormation stack with imported resources. The announcement came via the AWS blog.

The CloudFormation documentation has been updated and includes supported resources (CloudWatch Alarms, VPC and DynamoDB Tables are all supported).

Patrick
  • 703
  • 6
  • 16
  • Right, but according to the documentation : "During this import operation, you need to provide a template that describes the resources". It does not help to export an existing ressource into CloudFormation Template – fhiegel Sep 25 '20 at 08:51