I am trying to trigger an alarm if message is sent to SQS
. However, I see that the CloudWatch
metrics indicates that there was a message but no alarm is triggered.
The alarm is currently in INSUFFICIENT_DATA
state as well. For testing, I am sending a message via boto3
client.
Below is my CloudFormation Template for SQS
and CloudWatch
alarm
QueueMessageAlarm:
Type: AWS::CloudWatch::Alarm
Condition: AlarmsEnabled
Properties:
AlarmDescription: "Alarm if queue message is greater than 0"
AlarmActions:
- !Ref SampleNotificationTopic
Namespace: "AWS/SQS"
MetricName: "NumberOfMessagesReceived"
Statistic: "Sum"
Period: "900"
EvaluationPeriods: "1"
Threshold: "0"
ComparisonOperator: "GreaterThanThreshold"
Dimensions:
- Name: "QueueName"
- Value:
Fn::GetAtt:
- "KinesisStreamFileQueue"
- "QueueName"
KinesisStreamFileQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: "StreamQueue"