This is the lambda function which forwards cloudwatch alarm to slack.
- yarn
- awscli
- serverless framework
$ yarn global add serverless
- required packages
$ yarn
$ export region=( your region )
$ aws --region $region kms create-key | grep KeyId | cut -d\" -f 4 > .encrypt-key.$region
// copy template
$ cp .secret.json.example .secret.json
// input secret information
$ vim .secret.json
// generate encrypted yml
$ sls encrypt -n secretInfo -v "`cat .secret.json`" -k "`cat .encrypt-key.$region`"
$ sls offline
$ sls deploy