aws-liveness
AWS Liveness tools.
Install
npm i --save aws-liveness
Usage
const AWSLiveness = ;const DynamoDB = ; const awsLiveness = ;const dynamoDBClient = ; // ping and wait services up to 10 secondsawsLiveness ; // ping a serviceawsLiveness ;
Customization
You can customize and/or extend aws-liveness
tools to fit your application needs.
const AWSLiveness = ;const DynamoDB = ; async { return foo: 'bar' } const customServices = client instanceof DynamoDB client client instanceof MyCustomService client const awsLiveness = services: customServices ;const dynamoDBClient = ;const myCustomService = ; awsLiveness ; awsLiveness ;
Debug
AWS Liveness uses 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
.
Examples
Localstack
You can use this module to ensure that LocalStack services are up and running before you test and/or start your application.
// ping-localstack.jsconst dynamoDBClient = endpoint: processenvDYNAMODB_ENDPOINT; if requiremain === module awsLiveness ;
DYNAMODB_ENDPOINT=http://localhost:4569 npm run localstack-wait && npm run test-e2e
Contributing
-
Commits to
master
must be done through a Pull Request and Squash and Merge option. -
Add a title and body that follows the Conventional Commits Specification.