siutsin
siutsin

Reputation: 1624

How to remove subscription in AWS CloudWatch Log Groups

I am not able to delete these subscriptions attached to the CloudWatch Logs Groups.

screenshot

These subscriptions are created by CloudFormation stack via Serverless Framework. However, when I finished testing and deployed to the template, there was a permission error during the cleanup. Hence, these subscriptions became dangled and I am not able to locate it.

Tried with CLI and seems no relevant info regarding that.

$ aws logs describe-log-groups --log-group-name-prefix yyy
{
    "logGroups": [
        {
            "logGroupName": "yyy",
            "creationTime": 1555604143719,
            "retentionInDays": 1,
            "metricFilterCount": 0,
            "arn": "arn:aws:logs:us-east-1:xxx:log-group:yyy:*",
            "storedBytes": 167385869
        }
    ]
}

Upvotes: 1

Views: 2510

Answers (3)

Jishnu
Jishnu

Reputation: 474

As you created the subscription with cloudformation stack via serverless, manually removing the subscription filter as jarmod is not a best practice. What you should do is remove the cloudwatchLog event from the lambda functions and deploy, it should remove the subscriptions.

Upvotes: 0

jarmod
jarmod

Reputation: 78793

Select the Log Group using the radio button on the left of the Log Group name. Then click Actions, Remove Subscription Filter.

Remove Subscription Filter

Upvotes: 2

Tuan Vo
Tuan Vo

Reputation: 2075

Via CLI is listed in AWS document => This link

Via Console UI -> This capture

Upvotes: 1

Related Questions