## # This sample adds an SQS queue and an alarm on queue depth to the environment. # It does not provide credentials for accessing that queue or on-instance scripts. # # Customers would generally not edit this file. # Instead, they would have another file sitting in the same directory (or anywhere) with # an option-settings section such as the following (all of these are showing the default value) # # option-settings: # "aws:elasticbeanstalk:customoption" : # VisibilityTimeout : 30 # AlarmEmail : nobody@amazon.com # ## Resources: MySQSQueue: Type: AWS::SQS::Queue Properties: VisibilityTimeout: Fn::GetOptionSetting: OptionName: VisibilityTimeout DefaultValue: 30 AlarmTopic: Type: AWS::SNS::Topic Properties: Subscription: - Endpoint: Fn::GetOptionSetting: OptionName: AlarmEmail DefaultValue: "nobody@amazon.com" Protocol: email QueueDepthAlarm: Type: AWS::CloudWatch::Alarm Properties: AlarmDescription: "Alarm if queue depth grows beyond 10 messages" Namespace: "AWS/SQS" MetricName: ApproximateNumberOfMessagesVisible Dimensions: - Name: QueueName Value : { "Fn::GetAtt" : [ "MySQSQueue", "QueueName"] } Statistic: Sum Period: 300 EvaluationPeriods: 1 Threshold: 10 ComparisonOperator: GreaterThanThreshold AlarmActions: - Ref: AlarmTopic InsufficientDataActions: - Ref: AlarmTopic Outputs : QueueURL: Description : "URL of newly created SQS Queue" Value : { Ref : "MySQSQueue" } QueueARN : Description : "ARN of newly created SQS Queue" Value : { "Fn::GetAtt" : [ "MySQSQueue", "Arn"]} QueueName : Description : "Name newly created SQS Queue" Value : { "Fn::GetAtt" : [ "MySQSQueue", "QueueName"]}