I can create a Cloudwatch Log trigger in the Designer section of the Lambda dashboard by following these instructions. Everything works as expected. But, I'm having a very difficult time setting these up in Terraform.
I'm trying to subscribe the logzio cloudwatch shipper lambda function to the log group of a specific function. However, whenever I reference the log group of the function that I want to subscribe, I get the following error when I run terraform apply
command: The log group provided is reserved for the function logs of the destination function.
.
resource "aws_cloudwatch_log_subscription_filter" "test_lambdafunction_logfilter" {
name = "example"
log_group_name = aws_cloudwatch_log_group.example.name
filter_pattern = ""
destination_arn = aws_lambda_function.example.arn
depends_on = [aws_lambda_permission.example_cloudwatch]
}
What am I doing wrong?