{"id":20678582,"url":"https://github.com/codecentric/alert-template","last_synced_at":"2026-04-17T14:31:27.841Z","repository":{"id":144963968,"uuid":"103513121","full_name":"codecentric/alert-template","owner":"codecentric","description":"CloudFormation template for Slack alerts from CloudWatch alarms","archived":false,"fork":false,"pushed_at":"2017-09-18T13:24:07.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-17T15:16:37.431Z","etag":null,"topics":["aws","aws-lambda","cloudformation","slack-webhook"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecentric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-14T09:23:54.000Z","updated_at":"2019-11-12T14:15:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"7236776c-15f2-4a24-b9aa-dd877dd3e5c6","html_url":"https://github.com/codecentric/alert-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Falert-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Falert-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Falert-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Falert-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecentric","download_url":"https://codeload.github.com/codecentric/alert-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242911179,"owners_count":20205446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","cloudformation","slack-webhook"],"created_at":"2024-11-16T21:21:01.829Z","updated_at":"2026-04-17T14:31:22.813Z","avatar_url":"https://github.com/codecentric.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alert-template\nCloudFormation template for Slack alerts from CloudWatch alarms. Supports cluster, service, auto scaling and instance alarms.\n\nTo use this template, be sure to install Node.js and the AWK SDK. That done, `cd` to the repository root and run `npm install`.\n\nNext, create an S3 bucket in your region and enter its name in `.env`. \n\nFinally, build everything and sync the files to S3:\n\n```\n$ node_modules/gulp/bin/gulp.js build\n```\n\nThe `build` task lints, validates and tests the inputs before syncing files to S3. Alternatively, you can call the `lint`, `validate` and `test` tasks individually before building and syncing.\n\n## Sample host template\nTo create a basic monitored stack, instantiate `cfn/host-template.yml` in the CloudFormation web console or at the command line.\n```\n$ aws cloudformation create-stack --stack-name alert-test-stack --template-body file://host-template.yml \\\n--parameters \\\nParameterKey=AlertHookUrlBase64,ParameterValue=... \\\nParameterKey=KeyName,ParameterValue=... \\\nParameterKey=S3Bucket,ParameterValue=... \\\nParameterKey=S3LambdaKey,ParameterValue=post-slack-alert-0.1.0.zip \\\nParameterKey=S3TemplateKey,ParameterValue=alert-template.yml \\\nParameterKey=Stage,ParameterValue=test \\\n--capabilities CAPABILITY_IAM\n```\n`AlertHookUrlBase64` is the base64-encoded URL of the Slack webhook (including the leading `https://`). `KeyName` has to match an existing key pair (e.g. `ssh-user`). The parameter `S3Bucket` is the name of the bucket referenced in `.env` and used to sync templates and lambda to S3.\n\n## Adding the template to existing stacks\nTo add a nested alert stack to an existing template defining an ECS service, auto scaling group or EC2 instance, add the following parameters and resource:\n```\nParameters:\n  Stage:\n    Description: Stage\n    Type: String\n    Default: \"test\"\n    AllowedPattern: \"(test|prod)\"\n    ConstraintDescription: set stage to `test` or `prod`\n  S3Bucket:\n    Description: Bucket holding template and lambda\n    Type: String\n    Default: \"alert-template\"\n  S3TemplateKey:\n    Description: Template key\n    Type: String\n    Default: alert-template.yml\n  S3LambdaKey:\n    Description: Lambda key\n    Type: String\n    Default: post-slack-alert-0.1.0.zip\n  AlertHookUrlBase64:\n    Description: Base64-encoded Slack hook URL\n    Type: String\nResources:\n  ...\n  AlertStack:\n    Type: \"AWS::CloudFormation::Stack\"\n    Properties:\n      Parameters:\n        \"Source\": !Ref \"Host\"\n        \"Stage\": !Ref \"Stage\"\n        \"EC2InstanceId\": !Ref \"logical name of EC2 instance...\"\n        \"S3Bucket\": !Ref \"S3Bucket\"\n        \"S3Key\": !Ref \"S3LambdaKey\"\n        \"SlackHookUrlBase64\": !Ref \"AlertHookUrlBase64\"\n      TemplateURL: !Sub \"https://s3-${AWS::Region}.amazonaws.com/${S3Bucket}/${S3TemplateKey}\"\n      TimeoutInMinutes: 8\n    DependsOn: Host\n```\nNote that the S3 bucket must be local to the stack's AWS region.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecentric%2Falert-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecentric%2Falert-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecentric%2Falert-template/lists"}