Terraform module for cloudwatch-logs on aws
module "cloudwatch-logs" {
source = "registry.patterneddesigns.ca/essentials/cloudwatch-logs/aws"
version = "0.1.0"
}log_group_name
requiredName of the CloudWatch Log Group. Must be unique within your AWS account and region. Can contain a-z, A-Z, 0-9, '_', '-', '/', and '.' characters.
retention_in_daysNumber of days to retain log events. Valid values: 0 (never expire), 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653.
kms_key_arnKMS key ARN for log encryption. When specified, the CloudWatch Log Group will be encrypted using the provided KMS key.
metric_filtersMetric filters to create on the log group. Each filter transforms log data into CloudWatch metrics. Each object supports: - name: Unique name for the filter (required) - pattern: Filter pattern to match log events (required) - metric_name: Name of the CloudWatch metric (required) - metric_namespace: Namespace for the metric (required) - metric_value: Value to publish (optional, default: "1")
tagsTags to apply to the log group.
log_group_arnARN of the CloudWatch Log Group. Use this for IAM policies, subscription filters, and cross-account access.
log_group_nameName of the CloudWatch Log Group. Use this for referencing the log group in other resources and for CloudWatch Logs Insights queries.