Skip to main content
Mount @bijectionhq/app-documents for one table in an AWS commercial region. The mount publishes observations at the label the installer binds. The example uses a table whose contents can be disclosed publicly.

Mount and start

bijection/app.ts
Grant inventory.operator and call inventory.source.initialize with:
Read rows with inventory.documents.list and the source with inventory.source.health. Set the AWS session with bijection secret set session. Grant dynamodb:Scan on the selected table alone. Supply its partition key, followed by the sort key if the table has one. Both values must be strings. The combined JSON key is limited to 384 UTF-8 bytes. The example uses label.public. For protected data, declare a label with label() and pass it to dynamodbTable and as the app’s data. The installation charges retained work against the app’s data label’s reservation. See installer-bound labels.

Paging and recovery

The app uses one strongly consistent Scan item per request and accepts responses up to 36 KiB. It preserves the DynamoDB AttributeValue encoding in each record, including exact number strings. Each page lands with its LastEvaluatedKey, which the next request uses as ExclusiveStartKey. After the end of the table, the mount begins another traversal on its next poll. A Scan can see writes made between pages. The app makes no snapshot or deletion-by-absence inference. An oversize or invalid answer leaves the cursor in place. Use source.health to get the revision for polling, pausing, resuming, or resetting a source. A reset starts a new traversal and preserves previously observed items.

Capture DynamoDB Streams changes

Use one Documents mount per stream ARN with dynamodbStreams in place of dynamodbTable. Use the stream’s AWS region and the installer-bound label. Grant dynamodb:DescribeStream, dynamodb:GetShardIterator and dynamodb:GetRecords on the stream ARN. Enable NEW_IMAGE or NEW_AND_OLD_IMAGES on the table.
The mount pages through the stream topology automatically. It reads a child only after its parent has drained, and rotates among independent shards. The initial baseline starts at the oldest available events in the retained topology. An ancestor already absent from that first discovery is outside the baseline. Each exchange accepts up to 24 shard descriptions or one event, within a 15 KiB encoded answer limit. The mount upserts INSERT and MODIFY images and applies REMOVE events using the same string keys as Scan. It commits the data change and the shard’s sequence together. An expired iterator reopens at the retained sequence or the shard’s starting sequence. DynamoDB retains records for 24 hours. A trimmed position, lost undrained shard, or missing parent discovered after the baseline stops advancement. Review source.health before explicitly resetting the source. Configure a new mount for a replacement stream ARN. Scan and Streams use separate mounts. Deletion by absence is outside both modes. DynamoDB Streams shard lineage · DynamoDB Streams API · Amazon DynamoDB Scan API