Skip to content

A CDK construct which exposes an endpoint with the contents of a DynamoDB table

License

Notifications You must be signed in to change notification settings

cdklabs/cdk-dynamo-table-viewer

cdk-dynamo-table-viewer

An AWS CDK construct which exposes a public HTTP endpoint which displays an HTML page with the contents of a DynamoDB table in your stack.

SECURITY NOTE: this construct was built for demonstration purposes and using it in production is probably a really bad idea. It exposes the entire contents of a DynamoDB table in your account to the general public.

The library is published under the following names:

Language Repository
JavaScript/TypeScript cdk-dynamo-table-viewer
Python cdk-dynamo-table-viewer
.NET Eladb.DynamoTableViewer
Java com.github.eladb/cdk-dynamo-table-viewer
Go github.com/cdklabs/cdk-dynamo-table-viewer-go/dynamotableviewer

Usage (TypeScript/JavaScript)

Install via npm:

$ npm i cdk-dynamo-table-viewer

Add to your CDK stack:

declare const cookiesTable: dynamodb.Table;

const viewer = new TableViewer(this, 'CookiesViewer', {
  table: cookiesTable,
  title: 'Cookie Sales', // optional
  sortBy: '-sales'       // optional ("-" denotes descending order)
});

Notes:

  • The endpoint will be available (as an deploy-time value) under viewer.endpoint. It will also be exported as a stack output.
  • Paging is not supported. This means that only the first 1MB of items will be displayed (again, this is a demo...)
  • Supports CDK version 2.60.0 and above

License

Apache 2.0