Event target not getting created

Hi All,

I am using below two blocks to create a event rule & add a target as lambda function but only event rule is getting created, please suggest.

resource “aws_cloudwatch_event_rule” “sec-hub-ingress-lambda_rule” {
name = “sec-hub-ingress-lambda”
event_pattern = file("./event_pattern/sh.json")
}

resource “aws_cloudwatch_event_target” “sec-hub-ingress-lambda_rule_target” {
rule = aws_cloudwatch_event_rule.sec-hub-ingress-lambda_rule.name
arn = aws_lambda_function.sec-hub-ingress-lambda.arn
}