-
-
Notifications
You must be signed in to change notification settings - Fork 748
Closed
Description
Feature Request for provisioning the expected CloudWatch Log Group in TF, allowing for a retention_in_days to be set.
Something like:
logs.tf
resource "aws_cloudwatch_log_group" "lambda" {
count = var.attach_cloudwatch_logs_policy && var.lambda_at_edge ? 0 : 1
name = "/aws/lambda/${var.function_name}"
retention_in_days = var.cloudwatch_logs_retention
}
resource "aws_cloudwatch_log_group" "lambda-edge" {
count = var.attach_cloudwatch_logs_policy && var.lambda_at_edge ? 1 : 0
name = "/aws/lambda/us-east-1.${var.function_name}"
retention_in_days = var.cloudwatch_logs_retention
}
...with a complementary flip of the local.log_group_arns and removal of the logs:CreateLogStream perms.
On the minus-side, retention_in_days needs a value to be set, but defaulting var.cloudwatch_logs_retention to 3653 more-or-less matches the current behavior of "Never".
On the positive side, a module output detailing the Log Group makes it easier to attach a subscriber and route the logs centrally.
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels