{"id":22783060,"url":"https://github.com/amplify-education/serverless-log-forwarding","last_synced_at":"2025-04-12T22:21:08.270Z","repository":{"id":22644918,"uuid":"96917847","full_name":"amplify-education/serverless-log-forwarding","owner":"amplify-education","description":"Serverless plugin for forwarding CloudWatch logs to another Lambda function.","archived":false,"fork":false,"pushed_at":"2024-11-27T11:33:39.000Z","size":521,"stargazers_count":57,"open_issues_count":2,"forks_count":26,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-03-28T01:09:09.413Z","etag":null,"topics":["cloudwatch","forwarding","lambda","log","logging","serverless","serverless-plugin"],"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/amplify-education.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-07-11T17:11:46.000Z","updated_at":"2024-11-27T11:33:07.000Z","dependencies_parsed_at":"2024-06-18T15:35:54.318Z","dependency_job_id":"6d93a27d-56d0-453e-b1ce-3dd4eaa2b701","html_url":"https://github.com/amplify-education/serverless-log-forwarding","commit_stats":{"total_commits":107,"total_committers":20,"mean_commits":5.35,"dds":0.7383177570093458,"last_synced_commit":"8033c11356d30092386b8dfce7f64d198aed94bd"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplify-education%2Fserverless-log-forwarding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplify-education%2Fserverless-log-forwarding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplify-education%2Fserverless-log-forwarding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplify-education%2Fserverless-log-forwarding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amplify-education","download_url":"https://codeload.github.com/amplify-education/serverless-log-forwarding/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107828,"owners_count":20884797,"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":["cloudwatch","forwarding","lambda","log","logging","serverless","serverless-plugin"],"created_at":"2024-12-11T22:06:41.100Z","updated_at":"2025-04-04T02:06:26.370Z","avatar_url":"https://github.com/amplify-education.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-log-forwarding\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/amplify-education/serverless-domain-manager/master/LICENSE)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bb1e50c048434012bd57eb73225a089e)](https://www.codacy.com/app/CFER/serverless-log-forwarding?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=amplify-education/serverless-log-forwarding\u0026utm_campaign=badger)\n[![Build Status](https://travis-ci.org/amplify-education/serverless-log-forwarding.svg?branch=master)](https://travis-ci.org/amplify-education/serverless-log-forwarding)\n[![npm version](https://badge.fury.io/js/serverless-log-forwarding.svg)](https://badge.fury.io/js/serverless-log-forwarding)\n[![npm downloads](https://img.shields.io/npm/dt/serverless-log-forwarding.svg?style=flat)](https://www.npmjs.com/package/serverless-log-forwarding)\n\nServerless plugin for forwarding CloudWatch logs to another Lambda function.\n\n# About Amplify\n\nAmplify builds innovative and compelling digital educational products that empower teachers and students across the country. We have a long history as the leading innovator in K-12 education - and have been described as the best tech company in education and the best education company in tech. While others try to shrink the learning experience into the technology, we use technology to expand what is possible in real classrooms with real students and teachers.\n\n# Getting Started\n\n## Prerequisites\n\nMake sure you have the following installed before starting:\n* [nodejs](https://nodejs.org/en/download/)\n* [npm](https://www.npmjs.com/get-npm)\n* [serverless](https://serverless.com/framework/docs/providers/aws/guide/installation/)\n\n## Installing\n\nTo install the plugin, run:\n\n```shell\nnpm install serverless-log-forwarding\n```\n\nThen make the following edits to your `serverless.yaml` file:\n\n```yaml\nplugins:\n  - serverless-log-forwarding\n\ncustom:\n  logForwarding:\n    destinationARN: '[ARN of Lambda Function to forward logs to]'\n    # optional:\n    roleArn: '[ARN of the IAM role that grants Cloudwatch Logs permissions]'\n    filterPattern: '[filter pattern for logs that are sent to Lambda function]'\n    normalizedFilterID: true # whether to use normalized function name as filter ID\n    stages:\n      - '[name of the stage to apply log forwarding]'\n      - '[another stage name to filter]'\n    createLambdaPermission: true # whether to create the AWS::Lambda::Permission for the destinationARN (when policy size limits are a concern)\n\nfunctions:\n  myFunction:\n    handler: src/someHandler\n    # optional properties for per-function configuration:\n    logForwarding:\n      # set enabled to false to disable log forwarding for a single given function\n      enabled: false\n\n```\n\n## Running Tests\nTo run unit tests:\n```\nnpm run test\n```\n\nFor running integration tests you will need to log into you AWS account \nand set AWS_PROFILE environment variable, \nit will be used to create AWS entities for testing purposes\n```\nexport AWS_PROFILE=\u003cprofile_name\u003e\nexport SERVERLESS_LICENSE_KEY=\u003csls_license_key\u003e\nnpx npm run build\nnpx npm run integration-test\n```\n\nAll tests should pass. All unit tests should pass before merging.\nIntegration tests will probably take some time\n\nIf there is an error update the node_modules inside the root folder of the directory:\n```\nnpm install\n```\n\n## Writing Integration Tests\nUnit tests are found in `test/unit-tests`. \nIntegration tests are found in `test/integration-tests`. \n\n`test/integration-tests` contains configs folder, \nfor every test there is a folder with `serverless.yml` configuration and `logs_producer.py`.\n\nTo add another test create a folder for your test with the folder name that corresponds to test name\nand add code to run test to `test/integration-tests/integration-tests.ts`\n\n\n## Deploying\n\n---------\nThe plugin will be packaged with the lambda when deployed as normal using Serverless:\n\n```shell\nserverless deploy\n```\n\n# Responsible Disclosure\n\nIf you have any security issue to report, contact project maintainers privately.\nYou can reach us at \u003cgithub@amplify.com\u003e\n\n# Contributing\n\nWe welcome pull requests! For your pull request to be accepted smoothly, we suggest that you:\n1. For any sizable change, first open a GitHub issue to discuss your idea.\n2. Create a pull request.  Explain why you want to make the change and what it’s for.\nWe’ll try to answer any PRs promptly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplify-education%2Fserverless-log-forwarding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famplify-education%2Fserverless-log-forwarding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplify-education%2Fserverless-log-forwarding/lists"}