AWS QLDB Ledger

This page shows how to write Terraform and CloudFormation for QLDB Ledger and write them securely.

aws_qldb_ledger (Terraform)

The Ledger in QLDB can be configured in Terraform with the resource name aws_qldb_ledger. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "aws_qldb_ledger" "accounted_ledger" {
  name = var.name
  tags = var.tags
}
main.tf#L3
resource "aws_qldb_ledger" "default" {
  name             = "ledger"
  permissions_mode = "STANDARD"
}

resource "aws_qldb_ledger" "enabled" {
main.tf#L3
resource "aws_qldb_ledger" "standard" {
  name             = "ledger"
  permissions_mode = "STANDARD"
}

# failure

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides an AWS Quantum Ledger Database (QLDB) resource

NOTE: Deletion protection is enabled by default. To successfully delete this resource via Terraform, deletion_protection = false must be applied before attempting deletion.

AWS::QLDB::Ledger (CloudFormation)

The Ledger in QLDB can be configured in CloudFormation with the resource name AWS::QLDB::Ledger. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

serverless.yml#L89
      Type: AWS::QLDB::Ledger
      Properties:
        DeletionProtection: True
        Name: ${env:LEDGER_NAME}
        PermissionsMode: ALLOW_ALL

serverless.yml#L47
      Type: AWS::QLDB::Ledger
      Properties:
        Name: node-test-${self:provider.stage}
        DeletionProtection: false
        PermissionsMode: ALLOW_ALL
        Tags:
serverless.yml#L34
      Type: AWS::QLDB::Ledger
      Properties:
        Name: CarbonEconomy
        DeletionProtection: false
        PermissionsMode: ALLOW_ALL
        Tags:
serverless.yml#L34
      Type: AWS::QLDB::Ledger
      Properties:
        Name: qldb-simple-demo-${self:provider.stage}
        DeletionProtection: false
        PermissionsMode: ALLOW_ALL
        Tags:
Tables.yml#L3
    Type: AWS::QLDB::Ledger
    Properties:
      Name: ${self:custom.ledgerNames.SampleLedger.${opt:stage, self:provider.stage}}
      DeletionProtection: false
      PermissionsMode: STANDARD

template.json#L24
            "Type": "AWS::QLDB::Ledger",
            "Properties": {
                "Name": {
                    "Fn::Join": [
                        "",
                        [
QLDBLedgerSpecification.json#L22
    "AWS::QLDB::Ledger": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html",
      "Properties": {
        "PermissionsMode": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qldb-ledger.html#cfn-qldb-ledger-permissionsmode",
ledger-cloudformation-template.json#L20
            "Type": "AWS::QLDB::Ledger",
            "Properties": {
                "Name": { "Fn::Join": ["", [{ "Ref": "ledgerName" }, "-", { "Ref": "env" }]] },
                "PermissionsMode": "ALLOW_ALL"
            }
        }
awsResouceIconMatches.json#L1912
        "resourceType": "AWS::QLDB::Ledger",
        "filePath": null
      }
    ]
  },
  {
template.json#L1819
    "AWS::QLDB::Ledger": {
      "Type": "AWS::QLDB::Ledger",
      "Properties": {}
    },
    "AWS::LicenseManager::License": {
      "Type": "AWS::LicenseManager::License",

Parameters

Explanation in CloudFormation Registry

The AWS::QLDB::Ledger resource specifies a new Amazon Quantum Ledger Database (Amazon QLDB) ledger in your AWS account. Amazon QLDB is a fully managed ledger database that provides a transparent, immutable, and cryptographically verifiable transaction log owned by a central trusted authority. You can use QLDB to track all application data changes, and maintain a complete and verifiable history of changes over time.

For more information, see CreateLedger in the Amazon QLDB API Reference.

Frequently asked questions

What is AWS QLDB Ledger?

AWS QLDB Ledger is a resource for QLDB of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS QLDB Ledger?

For Terraform, the codeclout/AccountEd, bridgecrewio/checkov and bridgecrewio/checkov source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the whiteprompt/r-d-qldb-audits, mlewis7127/qldb-node-test and CarbonEconomy/CarbonEconomy source code examples are useful. See the CloudFormation Example section for further details.