{"id":26403545,"url":"https://github.com/fossamagna/amplify-console-notification","last_synced_at":"2025-03-17T15:34:21.822Z","repository":{"id":39092295,"uuid":"218700823","full_name":"fossamagna/amplify-console-notification","owner":"fossamagna","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-04T12:26:20.000Z","size":579,"stargazers_count":5,"open_issues_count":15,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-04T14:52:50.835Z","etag":null,"topics":["amplify","aws-lambda"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/fossamagna.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":"2019-10-31T06:40:28.000Z","updated_at":"2025-01-04T12:23:50.000Z","dependencies_parsed_at":"2022-09-16T22:24:30.763Z","dependency_job_id":"36f71da5-409b-4485-88f5-9a1b56727c66","html_url":"https://github.com/fossamagna/amplify-console-notification","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fossamagna%2Famplify-console-notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fossamagna%2Famplify-console-notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fossamagna%2Famplify-console-notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fossamagna%2Famplify-console-notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fossamagna","download_url":"https://codeload.github.com/fossamagna/amplify-console-notification/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244058719,"owners_count":20391156,"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":["amplify","aws-lambda"],"created_at":"2025-03-17T15:34:18.741Z","updated_at":"2025-03-17T15:34:21.817Z","avatar_url":"https://github.com/fossamagna.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amplify-console-notification\n\nSends notifications about Amplify Console to a Slack channel or Idobata room.\n\nSupport chat service:\n- Slack https://slack.com\n- Idobata https://idobata.io\n\nMade with ❤️ by fossamagna. Available on the AWS Serverless Application Repository\n\nLicense\nMIT License (@fossamagna)\n\n## Development\n\nThis project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.\n\n- notification - Code for the application's Lambda function.\n- events - Invocation events that you can use to invoke the function.\n- notification/tests - Unit tests for the application code. \n- template.yaml - A template that defines the application's AWS resources.\n\nThe application uses several AWS resources, including Lambda functions and an API Gateway API. These resources are defined in the `template.yaml` file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.\n\nIf you prefer to use an integrated development environment (IDE) to build and test your application, you can use the AWS Toolkit.  \nThe AWS Toolkit is an open source plug-in for popular IDEs that uses the SAM CLI to build and deploy serverless applications on AWS. The AWS Toolkit also adds a simplified step-through debugging experience for Lambda function code. See the following links to get started.\n\n* [PyCharm](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/welcome.html)\n* [IntelliJ](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/welcome.html)\n* [VS Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/welcome.html)\n* [Visual Studio](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/welcome.html)\n\n## Deploy the application\n\nThe Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.\n\nTo use the SAM CLI, you need the following tools.\n\n* AWS CLI - [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials].\n* SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)\n* Node.js - [Install Node.js 10](https://nodejs.org/en/), including the NPM package management tool.\n* Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition\u0026offering=community)\n\nThe SAM CLI uses an Amazon S3 bucket to store your application's deployment artifacts. If you don't have a bucket suitable for this purpose, create one. Replace `BUCKET_NAME` in the commands in this section with a unique bucket name.\n\n```bash\namplify-console-notification$ aws s3 mb s3://BUCKET_NAME\n```\n\nTo prepare the application for deployment, use the `sam package` command.\n\n```bash\namplify-console-notification$ sam package \\\n    --output-template-file packaged.yaml \\\n    --s3-bucket BUCKET_NAME\n```\n\nThe SAM CLI creates deployment packages, uploads them to the S3 bucket, and creates a new version of the template that refers to the artifacts in the bucket. \n\nTo deploy the application, use the `sam deploy` command.\n\n```bash\namplify-console-notification$ sam deploy \\\n    --template-file packaged.yaml \\\n    --stack-name amplify-console-notification-stack \\\n    --capabilities CAPABILITY_IAM \\\n    --parameter-overrides \\\n        AmplifySNSTopicArn=AMPLIFY_NOTIFICATION_TOPIC_ARN \\\n        WebHookURL=WEBHOOK_URL \\\n        SenderType=SENDER_TYPE\n```\n\nReplace `AMPLIFY_NOTIFICATION_TOPIC_ARN`, `SENDER_TYPE` and `WEBHOOK_URL` in the commands in this section with a sns topic arn of amplify notification, type of chat service and a Webhook URL of Slack or Idobata.\n\n## Use the SAM CLI to build and test locally\n\nBuild your application with the `sam build` command.\n\n```bash\ncd notification \u0026\u0026 npm run build \u0026\u0026 cd -\namplify-console-notification$ sam build\n```\n\nThe SAM CLI installs dependencies defined in `notification/package.json`, creates a deployment package, and saves it in the `.aws-sam/build` folder.\n\nTest a single function by invoking it directly with a test event. An event is a JSON document that represents the input that the function receives from the event source. Test events are included in the `events` folder in this project.\n\nRun functions locally and invoke them with the `sam local invoke` command.\n\n```bash\namplify-console-notification$ sam local invoke NotificationFunction --event events/event.json\n```\n\n## Add a resource to your application\nThe application template uses AWS Serverless Application Model (AWS SAM) to define application resources. AWS SAM is an extension of AWS CloudFormation with a simpler syntax for configuring common serverless application resources such as functions, triggers, and APIs. For resources not included in [the SAM specification](https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md), you can use standard [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) resource types.\n\n## Fetch, tail, and filter Lambda function logs\n\nTo simplify troubleshooting, SAM CLI has a command called `sam logs`. `sam logs` lets you fetch logs generated by your deployed Lambda function from the command line. In addition to printing the logs on the terminal, this command has several nifty features to help you quickly find the bug.\n\n`NOTE`: This command works for all AWS Lambda functions; not just the ones you deploy using SAM.\n\n```bash\namplify-console-notification$ sam logs -n NotificationFunction --stack-name amplify-console-notification-stack --tail\n```\n\nYou can find more information and examples about filtering Lambda function logs in the [SAM CLI Documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-logging.html).\n\n## Unit tests\n\nTests are defined in the `notification/tests` folder in this project. Use NPM to install the [Jest](https://jestjs.io/) and run unit tests.\n\n```bash\namplify-console-notification$ cd notification\nnotification$ npm install\nnotification$ npm run test\n```\n\n## Cleanup\n\nTo delete the sample application and the bucket that you created, use the AWS CLI.\n\n```bash\namplify-console-notification$ aws cloudformation delete-stack --stack-name amplify-console-notification-stack\namplify-console-notification$ aws s3 rb s3://BUCKET_NAME\n```\n\n## Resources\n\nSee the [AWS SAM developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html) for an introduction to SAM specification, the SAM CLI, and serverless application concepts.\n\nNext, you can use AWS Serverless Application Repository to deploy ready to use Apps that go beyond hello world samples and learn how authors developed their applications: [AWS Serverless Application Repository main page](https://aws.amazon.com/serverless/serverlessrepo/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffossamagna%2Famplify-console-notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffossamagna%2Famplify-console-notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffossamagna%2Famplify-console-notification/lists"}