1 回答
- 最新
- 投票最多
- 评论最多
1
Hi, the AWS API has everything you need. Write your Lambda using an AWS API SDK (e.g. Boto3 for Python) and call the following actions: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteLogGroup.html I hope this helps!
相关内容
- AWS 官方已更新 3 年前
To add to the above API call using boto3 you also need to have Lambda execution role(IAM role) to include below permissions to delete the log group and log streams
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:deleteLogGroup", "logs:deleteLogStream" ], "Resource": [ "arn:aws:logs:::*" ] } ] }