Guardian Multiple Configs
The 0.6.0
release of the Guardian Bearse feature now supports sending alarms to multiple Slack channels with Guardian stacks created in the same AWS Account and region. This can be useful for breaking up alerting of alarms to different channels when you have multiple environments/applications/teams monitoring AWS resources within the same account and region.
Setup
Create the payload defining the extra slack SNS topics and give them a meaningful name in the config block of your payload.
"extra_topics": [
{
"name": "<name>",
"type": "slack"
}
]
This will create a parameter for the guardian stack for the additional slack channel webhook url. The parameter is named <name>SlackWebhookURL
{
"stacksets": [
{
"name": "guardian",
"config": {
"extra_topics": [
{
"name": "uat",
"type": "slack"
}
]
},
"stack_instances": [
{
"accounts": [
"123456789123"
],
"regions": [
"ap-southeast-2"
],
"parameters": [
{
"key": "SlackWebhookURL",
"value": "https://hooks.slack.com/services/T11111111/B11111111/XXXXXXXXXXXXXXXXXXXXXXXX"
},
{
"key": "uatSlackWebhookURL",
"value": "https://hooks.slack.com/services/T11111111/B11111111/XXXXXXXXXXXXXXXXXXXXXXXX"
}
]
}
]
}
],
"version": "0.6.0"
}
When the stack is deployed a SNS topic is created by the stack named guardian-<name>-slack-notifier
which is used to trigger the CloudWatchToSlack lambda function. The function used the sns topic arn to determine which slack channel to send the message to.
Once deployed you can update you guardian config with the new sns topic, see guardian docs for more info
Topics:
UatSlack: arn:aws:sns:ap-southeast-2:123456789123:topic/guardian-uat-slack-notifier
Templates:
Ec2Instance:
GroupOverrides:
AlarmAction:
- UatSlack