AWS Lambda: Python 3.8
This time it was necessary to change the log retention period for a specific log group of CloudWatch LLogs, so Considering general purpose to other environments, I made a mechanism that can be changed at once by hitting Lambda.
Create Lambda, set the following in Lambda environment variables and execute.
days: Log retention period you want to change pattern: The name of the log group you want to change (regular expression) region: Target region (ap-northeast-1 is fine for the Tokyo region)
I decided to give it to Gist. Since it is a simple code, only the outline of the behavior below.
https://gist.github.com/tunalight/63d2f5260563de5103f844a1f4010b3d
Recommended Posts