---
title: "Discussion on \"Automate AWS CloudWatch Log Group Retention Using Lambda In Python\" | Hashnode"
description: "Discussion on \"Automate AWS CloudWatch Log Group Retention Using Lambda In Python\". When a new CloudWatch log group is created directly via console or via cloudwatch agent, a CloudWatch event rule triggers lambda to set retention date."
url: "https://hashnode.com/posts/automate-aws-cloudwatch-log-group-retention-using-lambda-in-python/61234970a5d08237f40e348b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Automate AWS CloudWatch Log Group Retention Using Lambda In Python](https://dheerajchoudhary.hashnode.dev/automate-aws-cloudwatch-log-group-retention-using-lambda-in-python?utm_source=hashnode&utm_medium=feed)

When a new CloudWatch log group is created directly via console or via cloudwatch agent, a CloudWatch event rule triggers lambda to set retention date.

Aug 23, 2021 · 3 min read · dheerajchoudhary.hashnode.dev  
Updated Jan 9, 2022  
Read the article

-   [#aws](https://hashnode.com/tag/aws)
-   [#aws-lambda](https://hashnode.com/tag/aws-lambda)
-   [#python](https://hashnode.com/tag/python)
-   [#2articles1week](https://hashnode.com/tag/2articles1week)

## Written by

[Dheeraj Choudhary](https://hashnode.com/@Dheeraj-Choudhary)

@Dheeraj-Choudhary · India

  
[View profile](https://hashnode.com/@Dheeraj-Choudhary)

Lets start from somewhere

I am a Technology Designer and YouTuber who likes to write Technical Blogs and contribute to Open Source which mainly includes Cloud, DevOps,Linux etc.

## Responses 1

Markdown supported · ⌘↵ to post

[Dipankar Chakraborty](https://hashnode.com/@Dipankar06)

[Aug 27, 2021](https://hashnode.com/posts/automate-aws-cloudwatch-log-group-retention-using-lambda-in-python/61234970a5d08237f40e348b/comment/6128e9859da1766342ad651f)

Good documentation... please mention details of specifying log retention policy during log group creation using CloudFormation.

[Dheeraj Choudhary](https://hashnode.com/@Dheeraj-Choudhary)

[Sep 7, 2021](https://hashnode.com/posts/automate-aws-cloudwatch-log-group-retention-using-lambda-in-python/61234970a5d08237f40e348b/comment/6128e9859da1766342ad651f#reply-6136d8d6e9421a617c32ff72)

Cloudformation code block is added to the blog.
