File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 3535
3636# MONITORING
3737AUTO_MONITOR = 'True'
38- MONITOR_SNS = 'arn:aws:sns:us-east-1:123456789123:Monitor' # Only necessary if auto-monitoring
3938
4039# CLOUDWATCH DASHBOARD CREATION
4140CREATE_DASHBOARD = 'True' # Create a dashboard in Cloudwatch for run
Original file line number Diff line number Diff line change @@ -658,12 +658,14 @@ def startCluster():
658658 "ApproximateNumberOfMessagesNotVisible" ,
659659 "ApproximateNumberOfMessagesVisible" ,
660660 ]
661+ sns = boto3 .client ("sns" )
662+ MonitorARN = sns .create_topic (Name = "Monitor" ) # returns ARN since topic already exists
661663 for metric in metricnames :
662664 response = cloudwatch .put_metric_alarm (
663665 AlarmName = f'{ metric } isZero_{ APP_NAME } ' ,
664666 ActionsEnabled = True ,
665667 OKActions = [],
666- AlarmActions = [MONITOR_SNS ],
668+ AlarmActions = [MonitorARN ],
667669 InsufficientDataActions = [],
668670 MetricName = metric ,
669671 Namespace = "AWS/SQS" ,
You can’t perform that action at this time.
0 commit comments