How to create a cloudwatch event using a cloudformation template?

I am using a scheduled cloudwatch event to trigger my lambda function after a specific time interval. I would like to use a cloud form template to add this rule to cloudwatch. I looked through the documentation for cloudformation templates, but I can’t find out how to configure events using the cloud formation template. Can anyone suggest how to implement it using a cloud formation template.

I am using the template below.

{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "Provision environment specific", "Resources": { "lambdaScheduler": { "Type": "AWS::CloudWatch::Event", "Properties": { "detail-type": "Scheduled Event", "source": "aws.events", "name": "TEST_EVENT_10_MINS_RULE", "schedule-expression": "rate(5 minutes)" } } } } 

I get an error A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template format error: Unrecognized resource type: AWS::CloudWatch::Event when I check it with aws cli.

+5
source share
2 answers

I am sure that CloudWatch Event is not opening through the CloudFormation API yet. Usually there is some lag between new features in AWS and their implementation / opening by the CloudFormation team.

Here is a list of resources currently available through CloudFormation. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html

As you can see, there is only one resource in the Cloudwatch namespace.

+3
source

Source: https://habr.com/ru/post/1244177/


All Articles