diff --git a/cloudwatch.tf b/cloudwatch.tf index 33baf71..61b32a4 100644 --- a/cloudwatch.tf +++ b/cloudwatch.tf @@ -29,13 +29,26 @@ resource "aws_cloudwatch_event_rule" "ec2_rule" { name = local.name description = "Capture EC2 Events to hande dynamic Route53 registration" event_pattern = jsonencode(local.cloudwatch_event_pattern) + + tags = merge( + local.base_tags, + var.tags, + map("Name", local.name), + ) } resource "aws_cloudwatch_event_target" "ec2_target" { - count = var.create ? 1 : 0 - target_id = local.name - arn = var.create ? aws_lambda_function.lambda[0].arn : null - rule = var.create ? aws_cloudwatch_event_rule.ec2_rule[0].name : null + count = var.create ? 1 : 0 + target_id = local.name + arn = var.create ? aws_lambda_function.lambda[0].arn : null + rule = var.create ? aws_cloudwatch_event_rule.ec2_rule[0].name : null + propagate_tags = true + + tags = merge( + local.base_tags, + var.tags, + map("Name", local.name), + ) } resource "aws_lambda_permission" "allow_cloudwatch" { diff --git a/version.tf b/version.tf index 8c978d6..980343a 100644 --- a/version.tf +++ b/version.tf @@ -1,3 +1,3 @@ locals { - _module_version = "0.0.10" + _module_version = "0.0.11" }