How to set Log Retention Expire to Log Group by boto3 or AWS CLI?


Hello, guys.

Thank you for your help in advance.

I would like to know how to set Log Retention Expire by boto3 or AWS CLI to Log Group.
If you know how to do that, please teach it to me.

Thank you.

asked 2 years ago158 views
1 Answer


Both boto3 and AWS CLI support CloudWatch Logs put-retention-policy.

Boto3 put_retention_policy() documentation:

AWS CLI put-retention-policy documentation:


answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions