title: AWS CloudWatch alarm for SQS Number of Messages Visible
body: <p>I am trying to capture the event of a new message in my FIFO queue (as I want to avoid , infinite polling of Queue) . </p>
  
  <p>For this purpose I am evaluating the CloudWatch alarm option with metrics ApproximateNumberOfMessagesVisible . </p>
  
  <p>Following is my Alarm description- </p>
  
  <p><strong>Threshold</strong>: The condition in which the alarm will go to the ALARM state.ApproximateNumberOfMessagesVisible >= 0 for 1 minute</p>
  
  <p><strong>Actions</strong>:The actions that will occur when the alarm changes state.
  In ALARM:<br>
  Send message to topic "topic_for_events_generated_bycloudwatch" (xyz@xyz)
  Send message to topic "topic_for_events_generated_bycloudwatch"</p>
  
  <p><strong>Period</strong>:The granularity of the datapoints for the monitored metric.1 minute</p>
  
  <p>Following are my queries - </p>
  
  <ol>
  <li>Assuming there are more than 0 messages in the given Q - will this alarm raised only once when the condition met or every minute ?</li>
  <li>During quick test I saw Alarm keeping moving between INSUFFICIENT and ALARM state in random other without any configuration changes, what could be rational ?</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/7wz6D.png" rel="nofollow noreferrer">Screenshot of ApproximateNumberOfMessagesVisible  metric graph</a>
  <a href="https://i.stack.imgur.com/K6oQY.png" rel="nofollow noreferrer">Screenshot of the log activity</a></p>
  
  <p>Thanks in advance. </p>
  
  <p>Regards, 
  Rohan K</p>