Add configuration for CloudWatch Log for choosing LogGroupClass
Is there an existing issue for this?
- [X] I have searched existing issues, it hasn't been reported yet
Use case description
AWS CloudWatch Log has just released a new option for log class at the 26th of November 2023. The new option is to use Infrequent Access log type on storing the logs in CloudWatch. This option is suitable for those who are not using features of CloudWatch Logs other than storing the logs as it enables 50% lower cost for data ingestion. Full announcement of the release is available here
Proposed solution (optional)
Add an additional configuration in the AWS function
functions:
myCloudWatchLog:
handler: myCloudWatchLog.handler
events:
- cloudwatchLog:
logGroup: '/aws/lambda/hello'
filter: '{$.userIdentity.type = Root}'
logClass: 'Infrequent Access'
Which value will be used in the CloudFormation LogGroupClass as described here. Example:
{
"Type" : "AWS::Logs::LogGroup",
"Properties" : {
"DataProtectionPolicy" : Json,
"KmsKeyId" : String,
"LogGroupClass" : String,
"LogGroupName" : String,
"RetentionInDays" : Integer,
"Tags" : [ Tag, ... ]
}
}
related: https://github.com/serverless/serverless/issues/12264
related: #12264
Jared I don’t think it’s related, it’s talking about some other logging feature.
@davidsoendoro please see this comment and confirm whether you agree on the mentioned approach
I'm interested in the same feature. AWS introduced CloudWatch logs Infrequent Access storage class, offering less cost than the standard one. However, it seems the serverless framework still hasn't adapted the feature yet.
it would be nice to have it.
Any update on this yet?