# This finds ALL log groups with "error" in the name and deletes them
for group in $(aws logs describe-log-groups --query 'logGroups[?contains(logGroupName, `error`)].logGroupName' --output text); do
echo "Deleting $group..."
aws logs delete-log-group --log-group-name "$group"
done
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme