meal-order-manager/terraform/logs.tf
Adam Moussa e35260a732
feat(infra): add lightweight meal-order-manager-dev (PLAT-210)
Parameterize the HCP root for seahaven-dev with schedules, PITR, alarms, and Paychex gated off so a second env does not clone production cost or side effects.
2026-09-18 13:15:35 -04:00

17 lines
707 B
HCL

# Log groups are created explicitly rather than left to Lambda's implicit
# on-first-invoke creation, so retention is enforced from the start. Each name
# matches the runtime default (/aws/lambda/<function-name>), and every function
# depends on its group.
resource "aws_cloudwatch_log_group" "function" {
for_each = local.function_packages
name = "/aws/lambda/${local.project}-${replace(each.key, "_", "-")}"
retention_in_days = local.is_prod ? 60 : 14
}
# Longer than the Lambda groups on purpose, for request-level forensics.
resource "aws_cloudwatch_log_group" "api_access" {
name = "/aws/apigateway/${local.project}"
retention_in_days = local.is_prod ? 90 : 14
}