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
Delete CloudWatch Log Groups using AWS Lambda function.asked 4 months ago
How to set access log output for access log output bucketAccepted Answerasked 5 months ago
How to set CloudWatch logs retention policy for Lambda in AWS Serverless Application Model (SAM)?Accepted Answerasked 5 months ago
How to set Log Retention Expire to Log Group by boto3 or AWS CLI?
How can you filter by json property in cloudwatch log?asked a year ago
Log Retention Lambdaasked a month ago
ECS Fargate Log Configuration - How to set the retention policy?Accepted Answerasked 10 months ago
How divide Log Group by each Lambda function alias?
CloudWatch Logs retention setting leaves behind empty log streamsasked 4 months ago
How to delete archive log file on Oracle RDS instanceasked 3 years ago