Giter Club home page Giter Club logo

nationalarchives.tdr-notifications's Introduction

TDR Notifications

This project is for sending slack/email messages in response to cloudwatch events. It supports several types of event:

  • ECR scan results. Each time there is an ECR repository scan, the scan results are checked. If there are any errors, a Slack and email message is sent.
  • Maintenance window results. When the Jenkins backup maintenance window runs, the results are checked and if it fails, a notification is sent.
  • Consignment export results. When the consignment export task finishes, a Slack message is sent with details of whether the export succeeded or failed.

Run locally

Set these environment variables, either on the command line or in IntelliJ depending on how you want to run the app:

  • SLACK_WEBHOOK: the webhook URL of a Slack app. You can create a new app in Slack for testing purposes. Use the #bot-testing channel rather than a team channel to avoid confusion and spam.
  • TO_EMAIL: the email address that alerts should be sent to. For testing purposes, this should normally be your own email address rather than a team one.

The app uses AWS services like Simple Email Service (SES) in the management account, so you will also need to update your AWS credentials file with temporary mgmt credentials.

Register your email address with SES, then click the link in the verification email:

aws ses verify-email-identity --email-address "[email protected]"

Then run the LambdaRunner app from IntelliJ, or run sbt run on the command line.

Adding new environment variables to the tests

The environment variables in the deployed lambda are encrypted using KMS and then base64 encoded. These are then decoded in the lambda. Because of this, any variables in src/test/resources/application.conf which come from environment variables in src/main/resources/application.conf need to be stored base64 encoded. There are comments next to each variable to say what the base64 string decodes to. If you want to add a new variable you can run echo -n "value of variable" | base64 -w 0 and paste the output into the test application.conf

nationalarchives.tdr-notifications's People

Contributors

mancuniansam avatar suzannehamilton avatar tomjking avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.