- 
                Notifications
    
You must be signed in to change notification settings  - Fork 35
 
feat: advanced logging config #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: advanced logging config #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f1f5d57    to
    9ba0591      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for configuring AWS Lambda logging settings through a new logging_config variable. The change allows users to specify log format (JSON or Text), application log level, system log level, and log group for Lambda functions.
- Added 
logging_configvariable with validation for log format - Implemented dynamic logging configuration blocks in both Lambda resources
 - Updated example to demonstrate JSON logging with INFO/WARN levels
 
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description | 
|---|---|
| variables.tf | Adds new logging_config variable with object type and validation | 
| main.tf | Implements dynamic logging_config blocks for both Lambda resources | 
| examples/fixtures/context/index.js | Updates example function to use different log levels | 
| examples/complete/main.tf | Adds example logging configuration | 
| README.md | Documents the new logging_config input parameter | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
9ba0591    to
    f64e41f      
    Compare
  
    758258c    to
    7985c9f      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 19 out of 21 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Allow configuring aws lambda logging
Sample:
```
logging_config = {
  log_format            = "JSON"
  application_log_level = "INFO"
  system_log_level      = "WARN"
}
```
    4122d6f    to
    2c74e19      
    Compare
  
    | 
           this PR is released with 8.4.0  | 
    
This pull request introduces advanced and more flexible CloudWatch Logs configuration options for AWS Lambda functions in the Terraform module. It allows users to define custom log group names, reuse existing log groups, set advanced logging configurations, and manage log group lifecycle behavior. The documentation and examples have also been updated to reflect these enhancements.
CloudWatch Logs Configuration Enhancements:
logging_configinput, allowing custom log group names, log formats, and log levels to be specified for Lambda functions. [1] [2] [3]create_cloudwatch_log_group = false, with the module now able to detect and use external log groups. [1] [2] [3]cloudwatch_logs_log_group_class,cloudwatch_logs_skip_destroy, andcreate_cloudwatch_log_groupto control log group class, deletion behavior, and resource management, respectively.Documentation and Examples:
README.mdwith clearer explanations, updated examples, and new references to advanced logging features and configuration options. [1] [2] [3]examples/cloudwatch-logsdemonstrating advanced logging configuration, log group reuse, and log subscription filters, along with supporting files and outputs. [1] [2] [3] [4] [5]These changes provide users with greater flexibility and control over Lambda logging, making the module more adaptable to complex infrastructure requirements.
References: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]