2

As part of the health check endpoint for my web application deployed to AWS, I'd like to include a check to ensure that DynamoDB is functional and available. I know that DynamoDB doesn't go down often, but when it does it will render this application unusable. As such, I'd like to know that's the reason as part of my health check.

Is there a programmatic endpoint (or part of the Java AWS SDK) that I can leverage to verify the health of DynamoDB? What about other AWS services, such as SQS or S3? Anything similar?

Shadowman
  • 11,150
  • 19
  • 100
  • 198
  • Do you have a repository wired to the database? If so, doing a findOne on that repository and having no exception is probably sufficient. – Compass Jan 27 '20 at 21:06

3 Answers3

2

You can run the DescribeTable operation. You should get a "TableStatus" property back. If that TableStatus is "Active", the table is ready for use.

See the docs here on the TableStatus property: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TableDescription.html

rishikarri
  • 3,462
  • 2
  • 13
  • 13
1

Health check should

  1. Ensure DB is up

  2. Ensure you can do appropriate operations on it. (there should be no permission issues.)

To ensure both the above are there you can do a query, on even a non existing item, if you get 404(not 403, 500), it should mean successful.

best wishes
  • 5,789
  • 1
  • 34
  • 59
0

You can use the AWS Health API to get status of AWS services, but this requires a business account: https://docs.aws.amazon.com/health/latest/ug/health-api.html

Jason Wadsworth
  • 8,059
  • 19
  • 32