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

0

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.

koki-n
已提问 4 年前853 查看次数
1 回答
1

Hello,

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

Boto3 put_retention_policy() documentation: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.put_retention_policy

AWS CLI put-retention-policy documentation: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/logs/put-retention-policy.html

Best,
Kevin

AWS
已回答 4 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则