@healthzkit/dynamo package provides HealthAdapter helpers for AWS SDK v2 aws-sdk and v3 @aws-sdk/client-dynamodb. Successful checks call ListTables with Limit: 1 and return ok with metadata.latencyMs plus any fields from an optional metadata hook; failures return fail with the caught error.
Install the adapter package and one AWS SDK:
Package entrypoints
@healthzkit/dynamo-dynamoV2Adapter,dynamoV3Adapter, and their option types.@healthzkit/dynamo/v2-dynamoV2Adapteronly.@healthzkit/dynamo/v3-dynamoV3Adapteronly.
Shared options
Both factories acceptBaseDynamoOptions:
Pass either
config or an existing client (not both). The shape depends on the adapter (see below).
dynamoV2Adapter (aws-sdk)
Peer: aws-sdk >= 2.
Uses the v2 DynamoDB client and listTables({ Limit: 1 }). Suitable for legacy services still on AWS SDK for JavaScript v2.
Config
The adapter lazily importsaws-sdk, constructs new AWS.DynamoDB(config) once, and reuses it across checks.
Existing client
dynamoV3Adapter (@aws-sdk/client-dynamodb)
Peer: @aws-sdk/client-dynamodb >= 3.
Uses DynamoDBClient and ListTablesCommand with Limit: 1. Prefer this for new code on AWS SDK for JavaScript v3.
Config
The adapter lazily imports@aws-sdk/client-dynamodb, constructs new DynamoDBClient(config) once, and reuses it across checks.
Existing client
Scheduling
For DynamoDB tables that should not be queried on every probe, pair these adapters with aschedule on the check so readiness reads cached results (see Scheduling).