Create a new log group in CloudWatch on AWS. I tried to verify if Lambda could do that.
make
import boto3
logs = boto3.client('logs')
response = logs.create_log_group(
logGroupName = "log/group/name"
)
make
response = logs.put_retention_policy(
#Log group name you want to give
logGroupName = "log/group/name",
#Retention period(Day)The set
retentionInDays = 14
)
[CloudWatch Logs in Boto 3 Documentation] (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.create_log_group)
Recommended Posts