Skip to content

Slack App to notification build result from AWS Amplify Console 🚀

Notifications You must be signed in to change notification settings

fossamagna/amplify-slack-bot

Repository files navigation

amplify-slack-bot

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Related article and project

About The Project

This project is Slack App with AWS Amplify to notifications the build result from AWS Amplify Console.

You can add email notifications to notify stakeholders when a build succeeds or fails. But, cannot notify to Chat service (e.g. Slack). If you use this app, You can take notification from Amplify Console with Slack.

Getting Started

Click DEPLOY TO AMPLIFY CONSOLE button

amplifybutton

service role

The amplify-slack-bot requires the addition of the following permissions to the service role.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Action": [
                "lambda:CreateFunctionUrlConfig",
                "lambda:GetFunctionUrlConfig",
                "lambda:DeleteFunctionUrlConfig",
                "lambda:UpdateFunctionUrlConfig",
                "sns:GetTopicAttributes",
                "sns:SetTopicAttributes",
                "sns:DeleteTopic",
                "sns:CreateTopic",
                "sns:Subscribe"
            ],
            "Resource": [
                "arn:aws:lambda:*:<accountId>:function:*",
                "arn:aws:sns:*:<accountId>:*"
            ]
        }
    ]
}

Create new Slack app

Since amplify-slack-bot works as a Slack app, you must visit your apps on the Slack API website, and click Create New App. Please follow here to set up the Slack app.

Register Secret Parameters

Once the Slack app is created, register the three secrets in the AWS parameter store.

  • SLACK_SIGNING_SECRET
  • SLACK_BOT_TOKEN
  • SLACK_DEFAULT_CHANNEL

A repository has been created in your GitHub account where you forked amplify-slack-bot. Clone the repository. Pull the deployed app by running the amplify pull command.

register-secret-parameters

Edit amplify/backend/function/slackApp/parameters.json

Set the ID of the deployed app to secretsPathAmplifyAppId in amplify/backend/function/slackApp/parameters.json.

{
  "secretsPathAmplifyAppId": "<appId>"
}

You can get the ID of the app by executing the following command. Replace the <appId> with its value. After rewriting the file, git commit it.

amplify env get --name dev | grep AmplifyAppId

After git push, Amplify Console will automatically start building and you will receive Amplify Console build notifications on the Slack channel you have set up.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache-2.0 License. See LICENSE for more information.

Contact

Masahiko MURAKAMI - @fossamagna

Project Link: https://github.com/fossamagna/amplify-slack-bot

Related article and project

About

Slack App to notification build result from AWS Amplify Console 🚀

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published