StackLatestDynamodbFunctions
encryptedDynamoDB
API reference for encryptedDynamoDB
Function: encryptedDynamoDB()
function encryptedDynamoDB(config): EncryptedDynamoDBInstance;Defined in: .tmp-stack/packages/stack/src/dynamodb/index.ts:39
Create an encrypted DynamoDB helper bound to an EncryptionClient.
Returns an object with encryptModel, decryptModel, bulkEncryptModels,
and bulkDecryptModels methods that transparently encrypt/decrypt DynamoDB
items according to the provided table schema.
Parameters
config
Configuration containing the encryptionClient and optional
logging / error-handling callbacks.
Returns
An EncryptedDynamoDBInstance with encrypt/decrypt operations.
Example
import { Encryption } from "@cipherstash/stack"
import { encryptedDynamoDB } from "@cipherstash/stack/dynamodb"
import { encryptedTable, encryptedColumn } from "@cipherstash/stack/schema"
const users = encryptedTable("users", {
email: encryptedColumn("email").equality(),
})
const client = await Encryption({ schemas: [users] })
const dynamo = encryptedDynamoDB({ encryptionClient: client })
const encrypted = await dynamo.encryptModel({ email: "a@b.com" }, users)