specify the region export AWS_DEFAULT_REGION=ap-northeast-1 aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \ awk '{print $2}' | grep -v ^$ | while read x; do echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done only delete loggroup name starting with /aws/lambda export AWS_DEFAULT_REGION=ap-northeast-1 aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \ awk '{print $2}' | grep ^/aws/lambda | while read x; do echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done