【发布时间】:2020-04-10 04:04:03
【问题描述】:
我想配置 CloudWatch Events 以使用 Terraform 将输入发送到 Lambda 函数。 我使用了以下脚本:
resource "aws_cloudwatch_event_rule" "aa-rule-event" {
count = "${var.count}"
name = "${var.application_name}-${element(var.names, count.index)}"
description = "${element(var.descriptions, count.index)}"
schedule_expression = "${element(var.cron-expressions, count.index)}"
is_enabled = "${element(var.rule-status-states, count.index)}"
}
resource "aws_cloudwatch_event_target" "aa-rule-target" {
count = "${var.count}"
rule = "${var.application_name}-${element(var.names, count.index)}"
target_id = "CloudWatchToLambda"
arn = "arn:aws:lambda:${var.aws_region}:${var.aws_account_number}:function:${var.application_name}-${element(var.target-lambda-function, count.index)}"
}
我需要通过此 CloudWatch 事件向目标 Lambda 提供输入。我知道可以配置输入,但是如何在 Terraform 中配置呢?
【问题讨论】:
标签: amazon-web-services terraform amazon-cloudwatch terraform-provider-aws