Required

string

Name of the CloudWatch Log Group. Must be unique within your AWS account and region.

Example:
log_group_name = "/aws/lambda/my-function"

Optional

number Default: 30

Number of days to retain log events in the log group. Set to 0 for indefinite retention.

Example:
retention_in_days = 30

KMS key ARN for log encryption. When specified, the CloudWatch Log Group will be encrypted using the provided KMS key.

Example:
kms_key_arn = "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
list(object({ name = string, pattern = string, metric_name = string, metric_namespace = string, metric_value = optional(string, "1") }))

Metric filters to create on the log group. Each filter transforms log data into CloudWatch metrics.

Example:
metric_filters = [{name = "ErrorCount", pattern = "ERROR", metric_name = "ErrorCount", metric_namespace = "MyApp"}]
map(string)

Tags to apply to the log group for organization, cost allocation, and access control.

Example:
tags = {Environment = "production", Team = "platform"}