我正在使用cloudwatch计划的事件在特定的时间间隔之后触发我的lambda函数。我想使用云形成模板在cloudwatch中添加此规则。我已经浏览了cloudformation模板文档,但我找不到使用云形成模板配置事件的方法。有没有人可以建议如何使用云形成模板来实现它。
我正在使用下面的模板。
{
"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)"
}
}
}
}
当我使用aws cli进行验证时,收到A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template format error: Unrecognized resource type: AWS::CloudWatch::Event
错误消息。
发布于 2016-05-10 22:49:02
发布于 2016-03-02 17:25:44
我非常确定CloudWatch事件还没有通过CloudFormation应用程序接口公开。在亚马逊网络服务中的新功能与CloudFormation团队实现/公开的新功能之间通常会有一些滞后。
这是目前可通过CloudFormation获得的资源列表。http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
可以看到,Cloudwatch名称空间中只有一个资源。
发布于 2020-05-21 23:18:45
您是否尝试过在CloudFormation设计器中布局您的设计?它只为每个元素创建存根代码,但它验证了整体设计。然后,您必须将大纲代码传输到编辑器以执行实际工作,但它应该避免您引用的错误。
https://stackoverflow.com/questions/35715716
复制相似问题