Skip to main content

What is this integration?

Amazon DynamoDB is a fast, flexible NoSQL database service for any scale.

What Monk manages

  • Table: create, update, delete

What the Agent can do and how to use it

  • Table Management: Create, update, and delete DynamoDB tables with custom schemas
  • Global Tables: Configure multi-region replication for global applications
  • Backup & Restore: Enable point-in-time recovery and on-demand backups
  • Scaling: Configure auto-scaling for read/write capacity (provisioned mode)
  • Streams: Enable DynamoDB Streams for change data capture
  • TTL: Configure time-to-live settings for automatic item expiration
  • Indexes: Create and manage global secondary indexes (GSI) and local secondary indexes (LSI)
Steps:
  1. Ensure AWS provider is added: monk cluster provider add -p aws
  2. monk update <namespace>/<name>

Auth

  • Uses AWS provider credentials configured via monk cluster provider add -p aws

Getting Started

  1. Ensure AWS provider is added:
monk cluster provider add -p aws
  1. Define a table (save as dynamodb.yaml):
namespace: aws-dynamo-db-example

simple-table:
  defines: aws-dynamo-db/dynamo-db-table
  region: us-east-1
  table_name: simple-example-table
  attribute_definitions:
    - AttributeName: id
      AttributeType: S
  key_schema:
    - AttributeName: id
      KeyType: HASH
  billing_mode: PAY_PER_REQUEST
  1. Create/update:
monk update aws-dynamo-db-example/simple-table
monk describe aws-dynamo-db-example/simple-table

Backup & Restore Actions

DynamoDB supports Point-in-Time Recovery (PITR) with 35-day continuous backups and On-Demand Backups that are retained indefinitely.
ActionDescription
get-backup-infoView PITR status and recent backups
create-snapshotCreate an on-demand backup
list-snapshotsList available backups
describe-snapshotGet detailed backup info
delete-snapshotDelete an on-demand backup
restoreRestore to a new table
get-restore-statusCheck restore progress
# View backup configuration
monk do my-app/my-table/get-backup-info

# Create an on-demand backup
monk do my-app/my-table/create-snapshot backup_name="pre-migration"

# List available backups
monk do my-app/my-table/list-snapshots

# Restore from backup to new table
monk do my-app/my-table/restore backup_arn="arn:aws:dynamodb:..." target_table="restored-table"

# Point-in-time restore (latest)
monk do my-app/my-table/restore use_latest="true" target_table="restored-table"

# Check restore status
monk do my-app/my-table/get-restore-status target_table="restored-table"
Note: DynamoDB restore always creates a new table - it does not overwrite the source.

Enable PITR in Definition

my-table:
  defines: aws-dynamo-db/dynamo-db-table
  region: us-east-1
  table_name: production-table
  point_in_time_recovery_enabled: true  # Enable 35-day continuous backup
  deletion_protection_enabled: true
  # ... key schema ...