Skip to content

Commit

Permalink
Update main.tf to change lambda log group retention time
Browse files Browse the repository at this point in the history
Moving to the managed lambda log group to add a retention time.
  • Loading branch information
jdsmithit authored Dec 18, 2023
1 parent 61541cc commit 93eb25e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _sub/security/security-bot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ resource "aws_lambda_function" "bot" {
SQS_FOLLOW_UP_QUEUE_URL = aws_sqs_queue.queue[0].id # `id` provides the URL
}
}
depends_on = [
aws_cloudwatch_log_group.lambda_log_group,
]
}

resource "aws_cloudwatch_log_group" "lambda_log_group" {
count = var.deploy ? 1 : 0
name = "/aws/lambda/${aws_iam_role.lambda[0].name}"
retention_in_days = 90
}

resource "aws_lambda_event_source_mapping" "sqs" {
Expand Down

0 comments on commit 93eb25e

Please sign in to comment.