1
votes

I am struggling to match CloudWatch metric count (as shown in CloudWatch Console ) with count shown in Billing (Estimate for current month ). Attached here are both screen shots.

1) According to below billing screen shot, I should have 10+9.597 = 19.597 metric Alarms

CloudWatch Billing

2) According to CloudWatch Console, I have only 3 Alarms. Infact I don't remember of creating more.

CloudWatch Console

  1. I have couple of In Alarms, but in current month ( billing period July ), have only one, see screen shot below.

Couple of In Alarms are shown in red, but they are for last month, which is already billed.

1 Alarm in July

Let me know please if you need more information or any specific screen shot from aws console.

4) Output of aws query

aws cloudwatch describe-alarms --query 'MetricAlarms[*].[AlarmName]' --region us-east-2 > metric-alarams

    Music-ReadCapacityUnitsLimit-BasicAlarm
    Music-WriteCapacityUnitsLimit-BasicAlarm
    TargetTracking-table/TextNote-AlarmHigh-09765769-6e5d-6cab83249c9d
    TargetTracking-table/TextNote-AlarmHigh-82c98240-0435-101ab605b404
    TargetTracking-table/TextNote-AlarmLow-a0552914-7d04-bd0d74cb9d9a
    TargetTracking-table/TextNote-AlarmLow-d4b5d3ff-9b62--b6fafd379abe
    TargetTracking-table/TextNote-ProvisionedCapacityHigh-1fc9e0fc--8fc1-c5830689655d
    TargetTracking-table/TextNote-ProvisionedCapacityHigh-e2f0ac8b--8826-fd764296f4e8
    TargetTracking-table/TextNote-ProvisionedCapacityLow-3e182ade--a070-3d1a515b01a5
    TargetTracking-table/TextNote-ProvisionedCapacityLow-e8f2afd9--8ccf-d7dad436cedb
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-AlarmHigh-7693771a-92ee-8cd83a388fec
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-AlarmHigh-b761bab7-a8e6-8386252be6b2
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-AlarmLow-2bc4ee0c-95c6-31721866055d
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-AlarmLow-8b591a75-be8f-ff3209a4b54e
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-ProvisionedCapacityHigh-a369b9dc-8d8f-40d2bb7966cb
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-ProvisionedCapacityHigh-d65c9c16-9313-aed4e691d811
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-ProvisionedCapacityLow-3bd977f5-9acb-b6608ff14d91
    TargetTracking-table/TextNote/index/textNoteSecondaryIndex-ProvisionedCapacityLow-f852b0c7-b066-5ac2734d9a65
    TargetTracking-table/texthash-AlarmHigh-26e45329-b495-85f3eda0f92e
    TargetTracking-table/texthash-AlarmHigh-7b2169a1-d914-50d8b09341d8
    TargetTracking-table/texthash-AlarmLow-844f04e2-8e2d-b38bb95e8f1b
    TargetTracking-table/texthash-AlarmLow-f7ae2480-7cb8-0bf1adffece6
    TargetTracking-table/texthash-ProvisionedCapacityHigh-ad8c3e30-9861-feb73bb2b88f
    TargetTracking-table/texthash-ProvisionedCapacityHigh-dc6e4a74-beab-1e55e10f25f6
    TargetTracking-table/texthash-ProvisionedCapacityLow-7f34588a-872e-26413a88f905
    TargetTracking-table/texthash-ProvisionedCapacityLow-c8bbf607-962b-c7ecd956a6f2
    awsec2-i-0fc458fad8fc7fac2-LessThanOrEqualToThreshold-CPUCreditBalance
1
Do a aws cloudwatch describe-alarms --query 'MetricAlarms[*].[AlarmName]' --region us-east-2 and see how many alarms are listed.jellycsc
@jellycsc - thanks, I run that query and updated results in Answer. There are 29 records, and except last one all are automatically generated while creating DynmoDB table. Does AWS consider all these for billing ? Finding no option to delete them ?GLK
yep, they are all billable items. You can use aws cloudwatch delete-alarms --region us-east-2 --alarm-names ... to delete them. See here for details.jellycsc
@jellycsc - thanks again for your help. meanwhile I disabled Autoscaling of tables using DynamoDB and all of the TargetTracking Alarms were automatically gone, rest of the Alarms I am deleting using your script. If you like you can send it as an answer so that I can upvote and accept it.GLK
Np. I'm glad I can help.jellycsc

1 Answers

1
votes

To view the alarm names of all the billable CW alarms in the us-east-2 region, use the following AWS CLI command:

aws cloudwatch describe-alarms --query 'MetricAlarms[*].[AlarmName]' --region us-east-2

You can delete them using:

aws cloudwatch delete-alarms --region us-east-2 --alarm-names ...