{"_id":"@financial-times/serverless-plugin-healthcheck","_rev":"35-365cd2a517fd19ed5ff011324bfd4145","name":"@financial-times/serverless-plugin-healthcheck","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.7":{"name":"@financial-times/serverless-plugin-healthcheck","version":"0.0.7","keywords":["serverless plugin healthcheck lambdas","serverless healthcheck","serverless plugin","lambda serverless","healthcheck lambda"],"author":{"name":"Geoff Thorpe"},"license":"MIT","_id":"@financial-times/serverless-plugin-healthcheck@0.0.7","maintainers":[{"name":"the-ft","email":"strategic.products@ft.com"}],"homepage":"https://github.com/Financial-Times/serverless-plugin-healthcheck#readme","bugs":{"url":"https://github.com/Financial-Times/serverless-plugin-healthcheck/issues"},"dist":{"shasum":"0ea7c43672785f1ddf83278517e82048ee6582fc","tarball":"https://registry.npmjs.org/@financial-times/serverless-plugin-healthcheck/-/serverless-plugin-healthcheck-0.0.7.tgz","integrity":"sha512-0Xk7gNDOhSVJIjWuzgMlyVFZA21hxPQaumcEqCUlfmQB+8uxwT5g1q4Hu40MDCld78vQ7Qoe8dZFIt8Vi7coDg==","signatures":[{"sig":"MEUCIQDkRkkrBqYJIKAI9f+0lnZbiapHDrQOGocJ5f7R6f9mPgIgR87+48VjcGbb0AiJik/JniVvYrlYCmGnBysBd1+KmZk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"src/index.js","_from":".","_shasum":"0ea7c43672785f1ddf83278517e82048ee6582fc","gitHead":"666525ec722b31636ca8e5eee564e22ec10e2289","scripts":{"lint":"standard src/**","lint:fix":"standard --fix src/**","precommit":"lint-staged"},"_npmUser":{"name":"the-ft","email":"strategic.products@ft.com"},"repository":{"url":"git+https://github.com/Financial-Times/serverless-plugin-healthcheck.git","type":"git"},"_npmVersion":"3.10.10","description":"Check your lambdas are healthy.","directories":{},"lint-staged":{"*.{js}":["standard --fix","git add"]},"_nodeVersion":"6.10.3","dependencies":{"bluebird":"^3.5.0","fs-extra":"^3.0.1","token-substitute":"^1.2.0"},"devDependencies":{"husky":"^0.14.3","standard":"^10.0.2","lint-staged":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-healthcheck-0.0.7.tgz_1513685159754_0.34537078137509525","host":"s3://npm-registry-packages"}},"0.0.8":{"name":"@financial-times/serverless-plugin-healthcheck","version":"0.0.8","keywords":["serverless plugin healthcheck lambdas","serverless healthcheck","serverless plugin","lambda serverless","healthcheck lambda"],"author":{"name":"Geoff Thorpe"},"license":"MIT","_id":"@financial-times/serverless-plugin-healthcheck@0.0.8","maintainers":[{"name":"robinmarr-ft","email":"robin.marr@ft.com"},{"name":"joannaskao","email":"joannaskao@gmail.com"},{"name":"callumlocke","email":"callum.locke@gmail.com"},{"name":"bobhaslett","email":"bob.haslett@ft.com"},{"name":"sdbernard","email":"steve.bernard@ft.com"},{"name":"aendrew","email":"aendrew@aendrew.com"},{"name":"i-like-robots","email":"matt+npm@maketea.co.uk"},{"name":"jakedchampion","email":"me@jakechampion.name"},{"name":"mattandrews","email":"matt@mattandre.ws"},{"name":"rowanmanning","email":"accounts@rowanmanning.co.uk"},{"name":"quarterto","email":"mwr.brennan@gmail.com"},{"name":"the-ft","email":"strategic.products@ft.com"}],"homepage":"https://github.com/Financial-Times/serverless-plugin-healthcheck#readme","bugs":{"url":"https://github.com/Financial-Times/serverless-plugin-healthcheck/issues"},"dist":{"shasum":"eed37432d695a9ee8aed6c82829f7a0956f5c0c6","tarball":"https://registry.npmjs.org/@financial-times/serverless-plugin-healthcheck/-/serverless-plugin-healthcheck-0.0.8.tgz","integrity":"sha512-xbb0kzMES5bmNcXRhVGlW4XCkdmZLmUMqNgWEj43lh7Ll9TZutN3qcCmU6P0RvOiJrm1ohVB9pIM3qOXdeAVqA==","signatures":[{"sig":"MEUCIQCZq/ZMXD2X9rDcK9yZZrrM8brXgoahe9En6J9PkcHpqgIgGWVsG6/j3DCis9Gbu54cr73OVc2S1N5Bb53q09Xawxs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"src/index.js","_from":".","_shasum":"eed37432d695a9ee8aed6c82829f7a0956f5c0c6","gitHead":"767cf6efede70045c97d2d66434c0fba6c2662a8","scripts":{"lint":"standard src/**","lint:fix":"standard --fix src/**","precommit":"lint-staged"},"_npmUser":{"name":"the-ft","email":"strategic.products@ft.com"},"repository":{"url":"git+https://github.com/Financial-Times/serverless-plugin-healthcheck.git","type":"git"},"_npmVersion":"3.10.10","description":"Check your lambdas are healthy.","directories":{},"lint-staged":{"*.{js}":["standard --fix","git add"]},"_nodeVersion":"6.10.3","dependencies":{"bluebird":"^3.5.0","fs-extra":"^3.0.1","token-substitute":"^1.2.0"},"devDependencies":{"husky":"^0.14.3","standard":"^10.0.2","lint-staged":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-healthcheck-0.0.8.tgz_1514899356436_0.2508526153396815","host":"s3://npm-registry-packages"}},"0.0.9":{"name":"@financial-times/serverless-plugin-healthcheck","version":"0.0.9","keywords":["serverless plugin healthcheck lambdas","serverless healthcheck","serverless plugin","lambda serverless","healthcheck lambda"],"author":{"name":"Geoff Thorpe"},"license":"MIT","_id":"@financial-times/serverless-plugin-healthcheck@0.0.9","maintainers":[{"name":"aendrew","email":"aendrew@aendrew.com"},{"name":"axgy","email":"a@ax.gy"},{"name":"bobhaslett","email":"bob.haslett@ft.com"},{"name":"briggsc","email":"charlie.briggs@bbc.co.uk"},{"name":"chee","email":"chee@snoot.club"},{"name":"conor-mullen","email":"conor.mullen@ft.com"},{"name":"ft-internal-products","email":"ip.engineering@ft.com"},{"name":"i-like-robots","email":"matt+npm@maketea.co.uk"},{"name":"jakedchampion","email":"me@jakechampion.name"},{"name":"joannaskao","email":"joannaskao@gmail.com"},{"name":"mattandrews","email":"matt@mattandre.ws"},{"name":"notlee","email":"lee@leemoody.co.uk"},{"name":"quarterto","email":"bren@153.io"},{"name":"robinmarr-ft","email":"robin.marr@ft.com"},{"name":"rowanmanning","email":"accounts@rowanmanning.co.uk"},{"name":"sdbernard","email":"steve.bernard@ft.com"},{"name":"tatiana.stantonian","email":"tatiana.stantonian@ft.com"},{"name":"the-ft","email":"strategic.products+npm@ft.com"}],"homepage":"https://github.com/Financial-Times/serverless-plugin-healthcheck#readme","bugs":{"url":"https://github.com/Financial-Times/serverless-plugin-healthcheck/issues"},"dist":{"shasum":"a6b26a8f65db1c127c3329eaf11e35baf5a1a3da","tarball":"https://registry.npmjs.org/@financial-times/serverless-plugin-healthcheck/-/serverless-plugin-healthcheck-0.0.9.tgz","fileCount":8,"integrity":"sha512-LzdWN/0kr8Y9cw7reVpVqTJoByZd6+fbGgYbXVXeYLvDJaz6cSeibcUbKfB6FIbB5KBpMIhzZB5Y+hW3Rz8IAA==","signatures":[{"sig":"MEUCIBTF+L32Uj4IZZ6f522nbvOoHnZtVzLzLrUlZ+a50zVoAiEA0GrWtBbjvMaPiLzfLpeTscGHA7br1FVV85zxy7uaIYw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":101650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2HJLCRA9TVsSAnZWagAAxvkP/3O/Pj9QQNb76cCRcXgn\na+jlDgBmWBCu3rMWK2QlEczWqCIpahewFKYWZP2BXhey+KkKi414vJKs9SLy\nz8lop/JaaUvqn2PbusIFOpLabAqw3HmEGs87JFOocDsy0SuyVN88ycljcCpy\nDub2gkDwwFIwdnfNh9iWJf7A5XjHM0EBtwimel2sr2v+fVcAMKzNkuzvj+MN\nTGYER3+yL+VdpgEZooVHVdxMjlNpGm/0X/kIDqg+5YGt6HJS0kko/2+XDI6g\nJLId9WR1wH+mi8jAfzxjRVH79jOXe8GRuCqoJCdB8inNCp9xbvF/ixLb95Wd\noQvFsHDByscu4WnrUdS5G6xu1qm8tGWe/VOvrAPLAoCZLDUVEuLtC/2zG7fE\nPkPYEmF9o7qrP8ntyBa5N/NiT5wJagttmEsUx4N36SRQs+LQi5veZMDYg6gM\nlT2lonBzJINbayUzSZ+eJZ8AM0a/D4xVRthjzaomgS3bs0hPiWpLOfZo72L4\nJSpYOu5GqN8g5L5JcR1cR0Nma+yM+79FBjIN5RnKIyuktgwGYIWAs0T7kBDA\nHeYLjkADNL8QazSTe7Not+lkYtoD5a6S7K7Ew06yA45bBMPCW2jmbJ9fyTMg\nuzl2vzZd9bZ1AP/47NnCfCFUhBik5667eIF/NVjWktChutiGn+rOTUIeBWRM\ndwm1\r\n=1l+2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.js","_from":".","_shasum":"a6b26a8f65db1c127c3329eaf11e35baf5a1a3da","gitHead":"fa0586fd70f455be1ec57b97f43a0ce33fd10166","scripts":{"lint":"standard src/**","lint:fix":"standard --fix src/**","precommit":"lint-staged"},"_npmUser":{"name":"the-ft","email":"strategic.products+npm@ft.com"},"repository":{"url":"git+https://github.com/Financial-Times/serverless-plugin-healthcheck.git","type":"git"},"_npmVersion":"3.10.10","description":"Check your lambdas are healthy.","directories":{},"lint-staged":{"*.{js}":["standard --fix","git add"]},"_nodeVersion":"6.10.3","dependencies":{"bluebird":"^3.5.0","fs-extra":"^3.0.1","token-substitute":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^0.14.3","standard":"^10.0.2","lint-staged":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/serverless-plugin-healthcheck_0.0.9_1574693436932_0.6568173461947655","host":"s3://npm-registry-packages"}}},"time":{"created":"2017-12-19T12:06:00.887Z","modified":"2026-06-23T16:04:02.653Z","0.0.7":"2017-12-19T12:06:00.887Z","0.0.8":"2018-01-02T13:22:37.476Z","0.0.9":"2019-11-25T14:50:37.074Z"},"bugs":{"url":"https://github.com/Financial-Times/serverless-plugin-healthcheck/issues"},"author":{"name":"Geoff Thorpe"},"license":"MIT","homepage":"https://github.com/Financial-Times/serverless-plugin-healthcheck#readme","keywords":["serverless plugin healthcheck lambdas","serverless healthcheck","serverless plugin","lambda serverless","healthcheck lambda"],"repository":{"url":"git+https://github.com/Financial-Times/serverless-plugin-healthcheck.git","type":"git"},"description":"Check your lambdas are healthy.","maintainers":[{"email":"code.management@ft.com","name":"the-ft"},{"email":"info+npm@rowanmanning.com","name":"rowanmanning"},{"email":"yay@chee.party","name":"chee"},{"email":"a@ax.gy","name":"alexwilson"},{"email":"howdy@aendra.com","name":"aendra"},{"email":"emma.lewis@ft.com","name":"emmalewis"},{"email":"lee@leemoody.co.uk","name":"notlee"},{"email":"hamza.samih@ft.com","name":"hamza.samih"},{"email":"robert.boulton@ft.com","name":"robertboulton"},{"email":"leila.micollier@ft.com","name":"leila.micollier"},{"email":"rob.godfrey@ft.com","name":"robgodfrey"}],"readme":"# Serverless HealthCheck Plugin\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![npm (scoped)](https://img.shields.io/npm/v/@financial-times/serverless-plugin-healthcheck.svg)](https://www.npmjs.com/package/@financial-times/serverless-plugin-healthcheck)\n[![npm](https://img.shields.io/npm/dw/@financial-times/serverless-plugin-healthcheck.svg)](https://www.npmjs.com/package/@financial-times/serverless-plugin-healthcheck)\n[![license](https://img.shields.io/npm/l/serverless-plugin-healthcheck.svg)](https://raw.githubusercontent.com/Financial-Times/serverless-plugin-healthcheck/master/LICENSE)\n\nCheck the health of your lambdas.\n\n**Requirements:**\n\n* Serverless _v1.12.x_ or higher.\n* AWS provider\n\n## How it works\n\nHealthcheck solves _heart beat_ by creating one schedule event lambda that invokes all the service lambdas you select in a configured time interval (default: 5 minutes) or a specific time, forcing your containers to report their status.\nIn aditional, it creates a new endpoint (named \\_\\_health by default) which can be called to provide a json summary of the current status of each healthcheck.\n\n## Setup\n\nInstall via npm in the root of your Serverless service:\n\n```\nnpm install serverless-plugin-healthcheck --save-dev\n```\n\n* Add the plugin to the `plugins` array in your Serverless `serverless.yml`:\n\n```yml\nplugins:\n  - serverless-plugin-healthcheck\n```\n\n* Add a `healthcheck` property to all the events in all the functions you want to be checked.\n\n```yml\nfunctions:\n  hello:\n    events\n      - http:\n          path: /schema/{TypeID}\n          method: get\n          private: false\n          healthcheck:\n            params: {\"subjectType\": \"system\"}\n      - http:\n          path: /schema/{TypeID}/{ItemID}\n          method: get\n          private: false\n          healthcheck:\n            params: {\"subjectType\": \"system\", \"subjectID\": \"dewey\"}\n```\n\n* Add additional format properties to trigger the output of a full diagnotic for each check\n\n```yml\n         healthcheck:\n            params: {\"subjectType\": \"system\"}\n            format:\n              id: fullschema\n              name: Get system schema\n              ok: []\n              severity: 2\n              businessImpact: Unable to describe system records\n              technicalSummary: The schema for the system type cannot be read from the CMDB\n              checkOutput: false\n              lastUpdated: []\n```\n\nNote that the ok and lastUpdated are reserved and will automatically be populated, as follows:\no ok is true when statuscode is 200, false otherwise\no lastUpdated is the date.time at which the check was ran\n\n* healthcheck to be able to `invoke` lambdas requires the following Policy Statement in `iamRoleStatements`:\n\n```yaml\niamRoleStatements:\n  - Effect: 'Allow'\n    Action:\n      - 'lambda:InvokeFunction'\n    Resource:\n    - Fn::Join:\n      - ':'\n      - - arn:aws:lambda\n        - Ref: AWS::Region\n        - Ref: AWS::AccountId\n        - function:${self:service}-${opt:stage, self:provider.stage}-*\n```\n\nIf using pre-check, the deployment user also needs a similar policy so it can run the healthcheck lambda.\n\n* All done! healthcheck will run on SLS `deploy` and `package` commands\n\n## Options\n\n* **cleanFolder** (default `true`)\n* **memorySize** (default `128`)\n* **name** (default `${service}-${stage}-healthcheck-plugin`)\n* **schedule** (default `rate(5 minutes)`)\n* **timeout** (default `10` seconds)\n* **precheck** (default `false`)\n* **endpoint** (default `__health`)\n\n```yml\ncustom:\n  healthcheck:\n    cleanFolder: false,\n    memorySize: 256\n    name: 'make-them-pop'\n    schedule: 'rate(15 minutes)'\n    timeout: 20\n    precheck: true\n    endpoint: _show_health\n```\n\n* define a custom header for the healtcheck to give the healtcheck output some contaxt\n\n```yml\n    endpoint: __health\n    format:\n      schemaVersion: 1\n      name: A great system that uses healthchecks\n      systemCode: greatsys\n      checks: []\n```\n\nNote that checks is reserved and is used to identify the location into which the array of check responses will be placed\n\n**Lambdas invoked by healthcheck will have event source `serverless-plugin-healthcheck`:**\n\n```json\n{\n    \"Event\": {\n        \"source\": \"serverless-plugin-healthcheck\"\n    }\n}\n```\n\n## Artifact\n\nIf you are doing your own [package artifact](https://serverless.com/framework/docs/providers/aws/guide/packaging#artifact) set option `cleanFolder` to `false` and run `serverless package`. This will allow you to extract the `healthcheck` NodeJS lambda file from the `_healthcheck` folder and add it in your custom artifact logic.\n\n## Gotchas\n\nIf you are deploying to a VPC, you need to use private subnets with a Network Address Translation (NAT) gateway (http://docs.aws.amazon.com/lambda/latest/dg/vpc.html). Healthcheck requires this so it can call the other lambdas but this is applicable to any lambda that needs access to the public internet or to any other AWS service.\n\nOnly one lambda function will be checked/invoked per HealthCheck declaration, even if multiple containers are running.\n\n## Cost\n\nLambda pricing [here](https://aws.amazon.com/lambda/pricing/). CloudWatch pricing [here](https://aws.amazon.com/cloudwatch/pricing/). You can use [AWS Lambda Pricing Calculator](https://s3.amazonaws.com/lambda-tools/pricing-calculator.html) to check how much will cost you monthly.\n\n### Example\n\nFree Tier not included + Default HealthCheck options + 10 lambdas to check, each with `memorySize = 1024` and `duration = 10`:\n\n* HealthCheck: runs 8640 times per month = $0.18\n* 10 checked lambdas: each invoked 8640 times per month = $14.4\n* Total = $14.58\n\nCloudWatch costs are not in this example because they are very low.\n\n## Contribute\n\nHelp us making this plugin better and future proof.\n\n* Clone the code\n* Install the dependencies with `npm install`\n* Create a feature branch `git checkout -b new_feature`\n* Lint with standard `npm run lint`\n\n## License\n\nThis software is released under the MIT license. See [the license file](LICENSE) for more details.\n","readmeFilename":"README.md"}