This repository was archived by the owner on Jun 8, 2022. It is now read-only.
  
  
  
  
  
Description
There's a small problem I'm having when using the module: The CloudWatch Log Group is only created when the Lambda Function tries to send its first logs. This poses a challenge when you want to use that Log Group somewhere else which relies on its existence (in my use case, Kinesis Data Stream).
I'll gladly put in a PR to create the Log Group if enable_cloudwatch_logs is true, but was just wondering whether this was something that has come up before?
Code example:
module "lambda" {
  source = "github.com/claranet/terraform-aws-lambda"
  function_name = "foo"
  description   = "foo"
  handler       = "foo.lambda_handler"
  runtime       = "python3.7"
  timeout       = 300
  source_path = "${path.module}/files/foo.py"
}
resource "aws_kinesis_stream" "bar" {
  name        = "bar"
  shard_count = "1"
}
resource "aws_cloudwatch_log_subscription_filter" "foo_to_bar" {
  name            = "foo-to-bar"
  log_group_name  = "/aws/lambda/foo"
  filter_pattern  = ""
  destination_arn = "${aws_kinesis_stream.bar.arn}"
}