log_group_name
RequiredName of the CloudWatch Log Group. Must be unique within your AWS account and region.
Example
log_group_name = "/aws/lambda/my-function"Naming Conventions
The log group name must be unique within your AWS account and region. Log group names can be between 1 and 512 characters and can contain the following characters: a-z, A-Z, 0-9, ‘_’ (underscore), ‘-’ (hyphen), ‘/’ (forward slash), and ‘.’ (period).
Common Patterns
- AWS Service Logs:
/aws/{service}/{resource}(e.g.,/aws/lambda/my-function) - Application Logs:
/app/{environment}/{service}(e.g.,/app/prod/api) - Custom Logs:
/{organization}/{application}/{component}(e.g.,/mycompany/webapp/frontend)
Best Practices
- Use forward slashes to create a hierarchical namespace
- Include environment identifiers for multi-environment setups
- Use consistent prefixes for related log groups
- Consider using AWS service prefixes (e.g.,
/aws/lambda/) for service-generated logs
Full Module Example
module "cloudwatch_logs" {
source = "registry.patterneddesigns.ca/essentials/cloudwatch-logs/aws"
version = "1.0.0"
# log_group_name
log_group_name = "/aws/lambda/my-function"
# Other required inputs
}