generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmain.tf
26 lines (19 loc) · 741 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module "rule_label" {
source = "cloudposse/label/null"
version = "0.25.0"
id_length_limit = 64
context = module.this.context
}
resource "aws_cloudwatch_event_rule" "this" {
name = module.rule_label.id
is_enabled = var.cloudwatch_event_rule_is_enabled
description = var.cloudwatch_event_rule_description != "" ? var.cloudwatch_event_rule_description : module.rule_label.id_full
event_pattern = jsonencode(var.cloudwatch_event_rule_pattern)
tags = module.this.tags
}
resource "aws_cloudwatch_event_target" "this" {
rule = aws_cloudwatch_event_rule.this.name
target_id = var.cloudwatch_event_target_id
arn = var.cloudwatch_event_target_arn
role_arn = var.cloudwatch_event_target_role_arn
}