[X] adds existing CloudWatch alarms for DB related metrics in Terraform
[X] adds a new CloudWatch alarm for ALB target response rate to monitor application server latency since we are about to scale down to 1 ECS task for production
[X] updates the lambda function to send alarms to Slack to include the above changes
[X] allows creation of the above mentioned alarms only on production
Checklist
[x] Description of PR is in an appropriate section of CHANGELOG.md and grouped with similar changes, if possible
Testing Instructions
Pull down the branch locally and change the count key's value to var.environment == "Staging" ? 1 : 0 in each newly added alarm resource. This is to enable alarms only for staging.
Create a test branch and push your locally changes up to test on staging
Go to AWS CloudWatch console and modify the newly added alarms. For example, change the alarm threshold to something below the current value of (i.e., target response rate at 0) the corresponding metric
Log in to staging site and perform some in-app operations to trigger the alarms
Make sure the alarms are sent to the subscribed SNS topic and the corresponding messages are reflected in the Slack channel.
Now change back the threshold of the alarm in the CloudWatch console. Use the app again. A new message of "service back to normal" should appear in Slack.
Overview
This PR:
Checklist
CHANGELOG.md
and grouped with similar changes, if possibleTesting Instructions
count
key's value tovar.environment == "Staging" ? 1 : 0
in each newly added alarm resource. This is to enable alarms only for staging.test
branch and push your locally changes up to test on staging0
) the corresponding metricCloses https://github.com/PublicMapping/districtbuilder/issues/1279