{"id":29776891,"url":"https://github.com/godaddy/aws-liveness","last_synced_at":"2025-07-27T10:21:04.585Z","repository":{"id":55013934,"uuid":"168564745","full_name":"godaddy/aws-liveness","owner":"godaddy","description":"AWS Liveness tools.","archived":false,"fork":false,"pushed_at":"2025-05-23T21:32:25.000Z","size":496,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-07-18T09:59:24.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/godaddy.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":"2019-01-31T17:19:05.000Z","updated_at":"2025-05-23T20:59:43.000Z","dependencies_parsed_at":"2023-12-06T15:44:06.688Z","dependency_job_id":null,"html_url":"https://github.com/godaddy/aws-liveness","commit_stats":{"total_commits":23,"total_committers":4,"mean_commits":5.75,"dds":0.6086956521739131,"last_synced_commit":"15463e0be823c79f7f825040999aa76104ef922b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/godaddy/aws-liveness","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Faws-liveness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Faws-liveness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Faws-liveness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Faws-liveness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godaddy","download_url":"https://codeload.github.com/godaddy/aws-liveness/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godaddy%2Faws-liveness/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266717377,"owners_count":23973364,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-07-27T10:20:57.829Z","updated_at":"2025-07-27T10:21:04.574Z","avatar_url":"https://github.com/godaddy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/godaddy/aws-liveness.svg?branch=master)](https://travis-ci.com/godaddy/aws-liveness) [![Greenkeeper badge](https://badges.greenkeeper.io/godaddy/aws-liveness.svg)](https://greenkeeper.io/)\n\n# aws-liveness\n\nWaits for AWS/localstack services to be up and running.\n\n## Install\n\n```console\nnpm i --save aws-liveness\n```\n\n## Usage\n\n```javascript\nimport AWSLiveness from '@godaddy/aws-liveness';\nimport { DynamoDBClient } from '@aws-sdk/client-dynamodb';\n\nconst awsLiveness = new AWSLiveness();\n\n// ping and wait services up to 10 seconds\ntry {\n  await awsLiveness.waitForServices({\n    clients: [new DynamoDBClient()],\n    waitSeconds: 10\n  });\n  console.log('services are live');\n} catch (err) {\n  console.error('service liveness failed', err);\n}\n\n// ping a service\ntry {\n  await awsLiveness.ping({ client: new DynamoDBClient() });\n  console.log('dynamodb ping success');\n} catch (err) {\n  console.error('dynamodb ping failed', err);\n}\n```\n\n## Customization\n\nBy default, `AWSLiveness` supports running the following liveness commands for the following client types:\n\n| Client | Method |\n| ------- | ------ |\n| `DynamoDBClient` | `ListTablesCommand` |\n| `KinesisClient` | `ListStreamsCommand` |\n| `S3Client` | `ListBucketsCommand` |\n| `SNSClient` | `ListPlatformApplicationsCommand` |\n| `SQSClient` | `ListQueuesCommand` |\n\n You can also create additional checks to customize liveness.\n\n```js\nimport AWSLiveness from '@godaddy/aws-liveness';\nimport { DynamoDBClient, DescribeTableCommand } from '@aws-sdk/client-dynamodb';\n\nclass MyCustomService {\n  async fetchSomeData () {\n    return { foo: 'bar' }\n  }\n}\n\nconst customServices = [{\n  test: client =\u003e client instanceof DynamoDBClient,\n  ping: client =\u003e client.send(new DescribeTableCommand({ TableName: 'Foo' }))\n}, {\n  test: client =\u003e client instanceof MyCustomService,\n  ping: client =\u003e client.fetchSomeData()\n}]\n\nconst awsLiveness = new AWSLiveness({ services: customServices });\nconst dynamoDBClient = new DynamoDBClient();\nconst myCustomService = new MyCustomService();\n\nawsLiveness.ping({ client: dynamoDBClient })\n  .then(() =\u003e console.log('dynamodb ping success'))\n  .catch(console.error);\n\nawsLiveness.ping({ client: myCustomService })\n  .then(() =\u003e console.log('my custom service ping success'))\n  .catch(console.error);\n```\n\n## Debug\n\nAWS Liveness uses [debug](https://www.npmjs.com/package/debug) module internally to log information about ping requests and services status. Logging is turned off by default and can be conditionally turned on by setting the `DEBUG` environment variable equals to `aws-liveness`.\n\n## Examples\n\n### Localstack\n\nYou can use this module to ensure that [LocalStack](https://www.localstack.cloud/) services are up and running before you test and/or start your application.\n\n```js\n// ping-localstack.js\nconst dynamoDBClient = new DynamoDBClient({\n  endpoint: process.env.DYNAMODB_ENDPOINT\n});\n\ntry {\n  await awsLiveness.waitForServices({\n    clients: [dynamoDBClient],\n    waitSeconds: process.env.WAIT_SECONDS || 10\n  });\n} catch (err) {\n  console.error('service liveness failed', err);\n  process.exit(1);\n}\n```\n\n```json\n{\n  \"scripts\": {\n    \"localstack\": \"docker run -it -p 4569:4569 -p 9999:8080 --rm localstack/localstack\",\n    \"localstack-wait\": \"AWS_ACCESS_KEY_ID=fakeid AWS_SECRET_ACCESS_KEY=fakekey node ping-localstack.js\",\n    \"test-e2e\": \"npm run localstack \u0026\u0026 npm run localstack-wait \u0026\u0026 AWS_ACCESS_KEY_ID=fakeid AWS_SECRET_ACCESS_KEY=fakekey mocha test-e2e/**/*.test.js\"\n  }\n}\n```\n\n## Contributing\n\n1. Commits to `master` must be done through a _Pull Request_ and _Squash and Merge_ option.\n\n2. Add a title and body that follows the [Conventional Commits Specification](https://www.npmjs.com/package/@commitlint/config-conventional).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodaddy%2Faws-liveness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodaddy%2Faws-liveness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodaddy%2Faws-liveness/lists"}