Skip to content
GitHubXDiscord

Ledger

The Ledger resource lets you manage AWS QLDB Ledgers for immutable and cryptographically verifiable transaction logs.

Create a basic QLDB Ledger with required properties and one optional tag.

import AWS from "alchemy/aws/control";
const simpleLedger = await AWS.QLDB.Ledger("simpleLedger", {
PermissionsMode: "ALLOW_ALL",
Tags: [
{
Key: "Environment",
Value: "Development"
}
]
});

Configure a ledger with deletion protection and a KMS key for enhanced security.

const secureLedger = await AWS.QLDB.Ledger("secureLedger", {
PermissionsMode: "ALLOW_ALL",
DeletionProtection: true,
KmsKey: "arn:aws:kms:us-east-1:123456789012:key/abcd-1234-abcd-1234-abcd1234abcd",
Tags: [
{
Key: "Environment",
Value: "Production"
}
]
});

Adopt an existing QLDB Ledger if it already exists without failing the operation.

const adoptedLedger = await AWS.QLDB.Ledger("existingLedger", {
PermissionsMode: "ALLOW_ALL",
adopt: true
});

Create a ledger and add multiple tags for better organization and billing.

const taggedLedger = await AWS.QLDB.Ledger("taggedLedger", {
PermissionsMode: "ALLOW_ALL",
Tags: [
{
Key: "Project",
Value: "Finance"
},
{
Key: "Owner",
Value: "Alice"
}
]
});