Connect
Introduced in v4.79.0.

aws_dynamodb_cdc

Enterprise license required

This component runs with a Redpanda Enterprise Edition license. Try it free for 30 days, or upgrade when you're ready.

Get a 30-day trial key Upgrade About licensing

Reads change data capture (CDC) events from DynamoDB Streams.

Consumes records from DynamoDB Streams with automatic checkpointing and shard management.

DynamoDB Streams capture item-level changes in DynamoDB tables. This input supports:

  • Automatic shard discovery and management

  • Checkpoint-based resumption after restarts

  • Concurrent processing of multiple shards

  • Optional initial snapshot of existing table data

  • Multi-table streaming with auto-discovery by tags or explicit table lists

Table discovery modes

This input supports three table discovery modes:

  • single (default) - Stream from the tables specified in the tables field

  • tag - Auto-discover and stream from multiple tables based on DynamoDB table tags. Use table_tag_filter to filter tables (for example, key:value)

  • includelist - Stream from an explicit list of tables specified in the tables field. This mode is kept for backward compatibility. Use single instead.

When the input streams from more than one table, it reads from all matching tables simultaneously. Each table maintains its own checkpoint state. In tag or includelist mode, use table_discovery_interval to periodically rescan for new tables (useful for dynamically tagged tables).

In tag mode, the input calls dynamodb:ListTables, then dynamodb:DescribeTable and dynamodb:ListTagsOfResource on every table it lists. Grant those two actions on every table in the region, not only on the tables that match the filter. A table the input cannot describe or read tags from is skipped with a warning.

Prerequisites

The source DynamoDB table(s) must have DynamoDB Streams enabled. You can enable streams with one of these view types:

  • KEYS_ONLY - Only the key attributes of the modified item

  • NEW_IMAGE - The entire item as it appears after the modification

  • OLD_IMAGE - The entire item as it appeared before the modification

  • NEW_AND_OLD_IMAGES - Both the new and old item images

Snapshots

When snapshot_mode is set to snapshot_only or snapshot_and_cdc, or incremental_snapshot.enabled is true, the input scans the entire table instead of, before, or while streaming changes. This is useful for:

  • Building a replica or cache with all existing data

  • Syncing historical data to a data warehouse

  • Populating a search index with existing records

The snapshot_only and snapshot_and_cdc modes are supported only when streaming from a single table. With table_discovery_mode: tag, either mode fails at startup, even when the filter matches only one table. An includelist with exactly one table supports them, unless signal_table_name is set. A signal table makes the input multi-table, so both modes then fail at startup. The incremental snapshot also works in multi-table mode, including with signal_table_name set.

Snapshots use the DynamoDB Scan API which consumes read capacity units (RCUs). For large tables, this can be expensive and take considerable time. Use snapshot_segments and snapshot_throttle to control RCU consumption.
In snapshot_only and snapshot_and_cdc modes, snapshots use eventually consistent reads and do not provide point-in-time consistency. Records modified during the snapshot may appear in both the snapshot and CDC stream (with different values). Use snapshot_deduplicate to minimize duplicates.

When incremental_snapshot.enabled is true, each table is backfilled page by page while it streams, in single- or multi-table mode. In multi-table mode, this includes tables found by periodic discovery. When signal_table_name is set, a table is instead backfilled when a snapshot-execute signal names it, apart from the exceptions listed under signal_table_name. A snapshot item is dropped when a stream record for its key arrives while its page is held. So no snapshot item leaves the input after a newer change to the same key. Once the stream catches up, the last event the input emits for each key matches that key’s current state in the table. This ordering holds at the input. Output stages with max_in_flight above 1 can still reorder messages. Incremental mode requires a stream view of NEW_IMAGE or NEW_AND_OLD_IMAGES, uses strongly consistent Scans (twice the RCU), and backfills each table once unless a signal asks for it again. Each page waits a few seconds for the stream to catch up before it is released, so for large tables raise snapshot_segments and snapshot_batch_size (for example to 10 and 1000). A backfill that fails is retried in the background from its acknowledged progress, while the table keeps streaming. In multi-table mode, a backfill that fails to start is retried the same way, and the other queued tables are backfilled meanwhile. In single-table mode, a backfill that fails the connection is retried with its own backoff. Retries wait 30 seconds at first and double up to 10 minutes between attempts. A failure that only a permission or configuration change can fix (AWS returns AccessDeniedException, UnrecognizedClientException or ValidationException, or the checkpoint table is missing) waits 10 minutes from the first attempt. In multi-table mode, a table deleted before its backfill completes is dropped from the queue, and the input logs an error. The input does not retry it until it restarts.

Checkpointing

Checkpoints are stored in a separate DynamoDB table (configured with checkpoint_table). This table is created automatically if it does not exist. On restart, the input resumes from the last checkpointed position for each shard. Snapshot progress is also checkpointed, allowing resumption mid-snapshot after failures. The principal needs dynamodb:UpdateItem on the checkpoint table, in addition to the read and write permissions it already uses. With incremental_snapshot.enabled: true, or when signal_table_name is set, it also needs dynamodb:DeleteItem on the checkpoint table, because resetting snapshot progress and clearing a handled snapshot request both delete rows.

Without a namespace, checkpoints are keyed only by stream and shard (or by source table and shard when global_table is enabled). Multiple pipelines that read the same stream and share one checkpoint_table without a namespace overwrite each other’s positions, which causes skipped or duplicated events.

Multiple independent pipelines can share a single checkpoint table by giving each one a distinct checkpoint_namespace (for example one namespace per developer or environment). Namespaces isolate checkpoints from each other: a pipeline only sees checkpoints written under its own namespace, so changing (or removing) the namespace causes the pipeline to restart from start_from. Namespaces do not coordinate consumers: two pipelines sharing the same namespace still overwrite each other’s checkpoints.

The namespace is prefixed to the checkpoint key. When a pipeline restarts under a namespace that has no checkpoints yet, it starts from start_from. With start_from: trim_horizon, this replays all records still available in the stream’s 24-hour retention window. Switching back to a previously used namespace resumes from that namespace’s last checkpoints.

Ordering across shard splits

DynamoDB Streams splits shards over time. The input reads a child shard only after its parent shard is read to the end, so the changes to an item keep their order. In these cases the input reads a child shard without waiting, and an older change to an item can arrive after a newer one:

  • The first start with start_from: latest. Every shard starts at its latest position.

  • A parent shard that the input cannot open for several refresh cycles. A warning is logged.

  • A parent shard that the stream reports as not found.

Downtime longer than the stream retention

DynamoDB Streams keeps records for 24 hours. If the pipeline stops for longer, a stored checkpoint can point at records that are gone, and the changes between the checkpoint and the oldest kept record are lost. A warning is logged.

  • With snapshot_mode: none, the shard resumes from TRIM_HORIZON.

  • With snapshot_mode: snapshot_and_cdc and a completed snapshot, the input runs the full snapshot again, so every item gets its current state. The CDC readers also resume from TRIM_HORIZON, so expect duplicates. The intermediate changes are still lost.

  • With incremental_snapshot.enabled: true and a completed backfill, the input resets the backfill and runs it again while the table streams. The CDC readers also resume from TRIM_HORIZON. The intermediate changes are still lost.

Alternative

For better performance and longer retention (up to 1 year vs 24 hours), consider using Kinesis Data Streams for DynamoDB with the aws_kinesis input instead.

Message format

Each change event is a JSON object with the fields tableName, eventID, eventName (INSERT, MODIFY, or REMOVE), eventVersion, eventSource, and awsRegion, plus a dynamodb object. The dynamodb object contains keys, newImage, and oldImage when the stream view type provides them, along with sequenceNumber, streamViewType, and sizeBytes. Snapshot records have an eventName of READ, carry the whole item in dynamodb.newImage, and carry its primary key in dynamodb.keys, as stream events do.

Attribute values are converted from DynamoDB’s typed format, such as {"S": "value"}, to plain values, such as "value". Number attributes stay strings, so convert them in a mapping if you need numeric values.

Metadata

This input adds the following metadata fields to each message:

  • dynamodb_shard_id - The shard ID from which the record was read (not set on snapshot records)

  • dynamodb_sequence_number - The sequence number of the record in the stream (not set on snapshot records)

  • dynamodb_approximate_creation_time - RFC3339 approximate creation time of the stream record (not set on snapshot records)

  • dynamodb_event_name - The type of change: INSERT, MODIFY, REMOVE, or READ (for snapshot records)

  • dynamodb_table - The name of the DynamoDB table

  • dynamodb_snapshot_segment - The scan segment that read the record (set only on snapshot records)

Metrics

This input emits the following metrics:

  • dynamodb_cdc_shards_tracked - Total number of shards being tracked (gauge)

  • dynamodb_cdc_shards_active - Number of shards currently being read from (gauge)

  • dynamodb_cdc_snapshot_state - Snapshot state: 0=not_started, 1=in_progress, 2=complete, 3=failed (gauge). In multi-table mode, it covers the incremental snapshot queue: in_progress while a table is backfilled, failed while a failed table waits to retry, and complete otherwise.

  • dynamodb_cdc_snapshot_records_read - Total records read during snapshot (counter)

  • dynamodb_cdc_snapshot_segments_active - Number of active snapshot scan segments (gauge)

  • dynamodb_cdc_snapshot_buffer_overflow - Incremented when the deduplication buffer exceeds its size limit, disabling dedup (counter)

  • dynamodb_cdc_snapshot_segment_duration - Time taken by each snapshot scan segment to complete (timer)

  • dynamodb_cdc_checkpoint_failures - Number of failed checkpoint writes to the checkpoint table (counter)

  • dynamodb_cdc_failover_skipped - Records skipped during global-table failover replay because they predate the resumed cutoff (counter)

  • dynamodb_cdc_snapshot_window_held_items - Snapshot items held in the incremental snapshot window, waiting for the streams to catch up (gauge)

  • dynamodb_cdc_snapshot_window_dropped_items - Snapshot items dropped by the incremental snapshot window because a stream record for the same key arrived while the page was read or held (counter)

  • dynamodb_cdc_snapshot_window_wait - Time from reading an incremental snapshot page to releasing it (timer)

  • dynamodb_cdc_snapshot_backfill_tables_pending - Tables queued for an incremental backfill that has not started yet (gauge)

Global table checkpoints (multi-region failover)

In active/active or active/passive multi-region deployments, set global_table: true and list the other regions in global_table_replicas so the auto-created checkpoint table is provisioned as a DynamoDB Global Table (v2). Checkpoints then replicate across regions: a failed-over pipeline resumes near the last committed position instead of replaying the whole stream. Because each region’s stream has its own sequence numbers, cross-region resume is time-based (at-least-once, replaying from the trim horizon up to the last replicated record time). Same-region restarts still resume exactly. If the checkpoint table already exists, enabling global_table reconciles it towards the desired configuration: any missing replica regions are added by calling UpdateTable. The existing table must have been created in global mode (it must use a TableId hash key). Pointing global_table at a pre-existing non-global checkpoint table fails fast with a clear error rather than mutating it.

When global_table is enabled the principal additionally needs dynamodb:CreateTable, dynamodb:UpdateTable, dynamodb:DescribeTable, dynamodb:DescribeLimits, iam:CreateServiceLinkedRole, and create/describe permissions in each replica region.

Use this reference to:

  • Look up configuration options for DynamoDB CDC streaming

  • Find metadata fields available for message processing

  • Identify checkpointing and performance tuning settings

  • Common

  • Advanced

input:
  label: ""
  aws_dynamodb_cdc:
    tables: []
    checkpoint_table: redpanda_dynamodb_checkpoints
    checkpoint_namespace: ""
    start_from: trim_horizon
    auto_replay_nacks: true
    snapshot_mode: none
    signal_table_name: ""
input:
  label: ""
  aws_dynamodb_cdc:
    tables: []
    table_discovery_mode: single
    table_tag_filter: ""
    table_discovery_interval: 5m
    checkpoint_table: redpanda_dynamodb_checkpoints
    checkpoint_namespace: ""
    global_table: false
    global_table_replicas: []
    batch_size: 1000
    poll_interval: 1s
    start_from: trim_horizon
    checkpoint_limit: 1000
    max_tracked_shards: 10000
    checkpoint_retry_initial_interval: 1s
    checkpoint_retry_max_interval: 30s
    auto_replay_nacks: true
    throttle_backoff: 100ms
    snapshot_mode: none
    snapshot_segments: 1
    snapshot_batch_size: 100
    snapshot_throttle: 100ms
    snapshot_deduplicate: true
    snapshot_buffer_size: 100000
    incremental_snapshot:
      enabled: false
      watermark_margin: 2s
      idle_shard_grace: 1m
    signal_table_name: ""
    region: "" # No default (optional)
    endpoint: "" # No default (optional)
    tcp:
      connect_timeout: 0s
      keep_alive:
        idle: 15s
        interval: 15s
        count: 9
      tcp_user_timeout: 0s
    credentials:
      profile: "" # No default (optional)
      id: "" # No default (optional)
      secret: "" # No default (optional)
      token: "" # No default (optional)
      from_ec2_role: false # No default (optional)
      role: "" # No default (optional)
      role_external_id: "" # No default (optional)

Message structure

Each CDC event is delivered as a JSON message with the following structure. Use these fields in your Bloblang mappings with this.<field>:

{
  "eventID": "abc123-",                    (1)
  "eventName": "INSERT | MODIFY | REMOVE",   (2)
  "eventSource": "aws:dynamodb",
  "awsRegion": "us-east-1",
  "tableName": "my-table",                   (3)
  "dynamodb": {
    "keys": {                                (4)
      "pk": "user#123",
      "sk": "profile"
    },
    "newImage": {                            (5)
      "pk": "user#123",
      "sk": "profile",
      "name": "Alice",
      "email": "alice@example.com"
    },
    "oldImage": {                            (6)
      "pk": "user#123",
      "sk": "profile",
      "name": "Alice Smith"
    },
    "sequenceNumber": "12345678901234567890", (7)
    "sizeBytes": 256,
    "streamViewType": "NEW_AND_OLD_IMAGES"
  }
}
1 Unique identifier for this change event.
2 Type of change: INSERT (new item), MODIFY (updated item), or REMOVE (deleted item).
3 Name of the source DynamoDB table.
4 Primary key attributes of the changed item. Always present.
5 Item state after the change. Present for INSERT and MODIFY events (requires NEW_IMAGE or NEW_AND_OLD_IMAGES stream view type).
6 Item state before the change. Present for MODIFY and REMOVE events (requires OLD_IMAGE or NEW_AND_OLD_IMAGES stream view type).
7 Position of this record in the shard, used for ordering and checkpointing.

Example mapping

pipeline:
  processors:
    - mapping: |
        root.event_type = this.eventName
        root.table = this.tableName
        root.keys = this.dynamodb.keys
        root.new_data = this.dynamodb.newImage
        root.old_data = this.dynamodb.oldImage

Fields

auto_replay_nacks

Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure.

Set auto_replay_nacks to false to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation.

Requires version 4.106.0 or later.

Type: bool

Default: true

batch_size

Maximum number of records to read per shard in a single request. Valid range: 1-1000.

Type: int

Default: 1000

checkpoint_limit

Maximum number of unacknowledged messages before forcing a checkpoint update. Lower values provide better recovery guarantees but increase write overhead.

Type: int

Default: 1000

checkpoint_namespace

Isolates this pipeline’s checkpoints within a shared checkpoint_table by prefixing the namespace to the checkpoint key. Use this so that multiple pipelines reading the same stream can share one checkpoint table without overwriting each other’s positions, for example per-developer or per-environment test pipelines. Leave empty (the default) to keep the original checkpoint keys unchanged. A namespace isolates readers but does not coordinate them: pipelines that share the same namespace still collide. Changing or removing the namespace changes the checkpoint key. If no checkpoints exist yet under the new key, the pipeline starts from start_from. Switching back to a previously used namespace resumes from that namespace’s last checkpoints. The value cannot contain a # character.

Requires version 4.101.0 or later.

Type: string

Default: ""

checkpoint_retry_initial_interval

Time to wait before retrying a failed checkpoint write. The wait doubles after each consecutive failure, up to checkpoint_retry_max_interval, and resets once every failed write has landed. Shards whose writes succeed keep being checkpointed while a failed shard waits.

Requires version 4.119.0 or later.

Type: string

Default: 1s

checkpoint_retry_max_interval

Maximum time to wait between retries of a failed checkpoint write. While the checkpoint table keeps failing, acknowledged positions and closed shards' completion markers stay unpersisted for up to this long between attempts.

Requires version 4.119.0 or later.

Type: string

Default: 30s

checkpoint_table

DynamoDB table name for storing checkpoints. Will be created if it doesn’t exist.

Type: string

Default: redpanda_dynamodb_checkpoints

credentials

Manually configure the AWS credentials to use (optional). For more information, see the Amazon Web Services guide.

Type: object

credentials.from_ec2_role

Use the credentials of a host EC2 machine configured to assume an IAM role associated with the instance.

Type: bool

credentials.id

The ID of the AWS credentials to use.

Type: string

credentials.profile

The profile from ~/.aws/credentials to use.

Type: string

credentials.role

The ARN of the role to assume.

Type: string

credentials.role_external_id

An external ID to use when assuming a role.

Type: string

credentials.secret

The secret for the AWS credentials in use.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Secrets.

Type: string

credentials.token

The token for the AWS credentials in use. Required only when using short-term credentials.

Type: string

endpoint

A custom endpoint URL for AWS API requests. Use this to connect to AWS-compatible services or local testing environments instead of the standard AWS endpoints.

Type: string

global_table

Provision the checkpoint table as a DynamoDB Global Table (v2) so checkpoints replicate across regions. Requires global_table_replicas. When the table is auto-created it is created as a global table; when it already exists, its replicas are reconciled (missing regions are added by calling UpdateTable). The existing table must have been created in global mode (TableId hash key). Enabling this against a pre-existing non-global checkpoint table fails fast with a clear error.

Requires version 4.99.0 or later.

Type: bool

Default: false

global_table_replicas[]

Regions other than this pipeline’s own region to replicate the checkpoint table to. The pipeline’s own region is always included. Required when global_table is true. Applied both when the checkpoint table is created and, for an existing global table, when reconciling replicas (missing regions are added; this list is not used to remove regions).

Requires version 4.99.0 or later.

Type: array<string>

Default: []

incremental_snapshot

Backfills each table while it streams, the same way as incremental_snapshot in postgres_cdc and mongodb_cdc. Turn it on with enabled. The other fields tune it and have no effect while it is off. The page size, segment count and throttle come from snapshot_batch_size, snapshot_segments and snapshot_throttle.

Requires version 4.120.0 or later.

Type: object

incremental_snapshot.enabled

Backfills each table while streaming, in single- or multi-table mode (in multi-table mode, tables found by discovery are backfilled too). It never emits a snapshot item after a newer change to the same key. With signal_table_name set, a table is backfilled only when a snapshot-execute signal names it, apart from the exceptions listed under signal_table_name. It requires a stream view of NEW_IMAGE or NEW_AND_OLD_IMAGES, and reads with strongly consistent Scans (twice the RCU of the other modes). It backfills a table once, even if that table was previously only streamed. A snapshot-execute signal backfills a completed table again. Each page waits a few seconds for the stream to catch up, so for large tables raise snapshot_segments and snapshot_batch_size (for example to 10 and 1000). It also needs dynamodb:DeleteItem on the checkpoint table, because a stale-checkpoint reset and a repeat signal delete snapshot progress rows. It needs snapshot_mode: none: the other modes read the same items, and the input fails to start if both are set.

Type: bool

Default: false

incremental_snapshot.idle_shard_grace

How long a stream shard that has never returned a record must keep returning empty reads before it is treated as caught up. Until then it holds back every snapshot page of its table. It also bounds how long a listed shard that has no reader yet (for example one that is still failing to start) holds back pages. This only affects the order in which snapshot items leave the input relative to older stream events. It does not affect the correctness of the final value emitted for each key.

Type: string

Default: 1m

incremental_snapshot.watermark_margin

Extra time a snapshot page is held after every shard has streamed past the time of its Scan. The margin covers clock skew between this host and AWS, plus stream publication delay. For an idle shard, the input treats the start of its last empty poll, minus this margin, as the point the shard has streamed to. A page can therefore wait up to twice the margin before release. This only affects the order in which snapshot items leave the input relative to older stream events. It does not affect the correctness of the final value emitted for each key.

Type: string

Default: 2s

max_tracked_shards

Maximum number of shards holding acknowledgement state at once. A shard is normally forgotten once it has been read to the end, its last batch has been acknowledged and its final checkpoint is written. This limit therefore bounds the shards being read concurrently, not the shards seen over the pipeline’s lifetime. Past this limit acknowledgements return an error.

Type: int

Default: 10000

poll_interval

Time to wait between polling attempts when no records are available.

Type: string

Default: 1s

region

The AWS region in which your resources are hosted.

Type: string

signal_table_name

A DynamoDB table used to send control signals to the input. Leave empty (the default) to disable control signals. When set, the table must exist and have a stream enabled with view type NEW_IMAGE or NEW_AND_OLD_IMAGES, otherwise the input fails to connect. It must not also appear in tables, which is rejected at startup. Tag discovery never treats it as a source table, even when its tags match. The signal table is always streamed alongside the source tables. So the input runs in multi-table mode whenever it is set, and snapshot_mode must then be none.

Each signal is an item with these attributes:

  • id: the table’s partition key, of any scalar type. It identifies the signal in logs. Each signal must use a new id, for example a UUID or a timestamp

  • type: a string (S), the signal type (see supported signals below)

  • data: a string (S) holding a JSON object with the signal parameters

Only inserted items are signals. Modified and removed items are streamed but not acted on. Writing a signal with an id already in the table overwrites that item and has no effect (the input logs a warning). Write each signal with a new id.

Signals are read from the signal table’s stream like any other change. With start_from: trim_horizon (the default) and no checkpoint state yet, the first start reads the stream’s retained records, which cover the last 24 hours. So snapshot-execute items written in that time are executed on that first start.

Signal records are emitted downstream as regular messages, with the dynamodb_table metadata field set to the signal table. To exclude them from downstream processing, filter on that field with a mapping processor:

pipeline:
  processors:
    - mapping: |
        root = if meta("dynamodb_table") == "rpcn_signals" { deleted() } else { this }

Supported signals

log: recognized and logged when received. The data attribute must contain a JSON object with a message key, whose value is written to the input’s log output.

snapshot-execute: backfills the named tables incrementally, alongside streaming. Requires incremental_snapshot.enabled: true. Without it, the signal is logged with a warning and ignored. The data attribute must contain a JSON object with a tables key listing table names, for example {"tables": ["orders", "customers"]}. Every named table must be one this input streams, with a stream view of NEW_IMAGE or NEW_AND_OLD_IMAGES. If any table fails these checks, the whole request is rejected and logged, and nothing is queued.

With incremental_snapshot.enabled: true and signal_table_name set, tables are backfilled only on request. At startup, and for tables found by discovery, a table is queued only when one of these is true:

  • It has a backfill in progress.

  • It has a request recorded that has not completed.

  • It has a completed backfill whose stream checkpoint is stale (the stream has trimmed changes the backfill no longer covers). That backfill is reset and run again.

Every other table waits for a signal.

Each table joins the back of the backfill queue. A table already queued is not queued twice. A table being backfilled finishes its current backfill and is not queued again, and the input logs a warning. To read that table again, send the signal again once its backfill completes. A table whose backfill has completed is read again from the start, so to snapshot a table again, send another signal that names it.

A table’s snapshot rows (snapshot#complete, snapshot#segment#N and snapshot#requested) are in that table’s partition of the checkpoint table. The partition’s hash key is the table’s stream ARN, or the source table name when global_table is set. It is prefixed with <namespace># when checkpoint_namespace is set.

Send a signal with the AWS CLI, generating a new id for each one:

aws dynamodb put-item --table-name rpcn_signals --item '{
  "id":   {"S": "'"$(uuidgen)"'"},
  "type": {"S": "snapshot-execute"},
  "data": {"S": "{\"tables\": [\"orders\"]}"}
}'

Requires version 4.120.0 or later.

Type: string

Default: ""

# Examples:
signal_table_name: rpcn_signals

snapshot_batch_size

Records per scan request during snapshot. Maximum 1000. Lower values provide better backpressure control but require more API calls.

Requires version 4.82.0 or later.

Type: int

Default: 100

snapshot_buffer_size

Maximum scanned item keys to buffer for deduplication (approximately 100 bytes per entry). If exceeded, deduplication is disabled and duplicates may be emitted. It has no effect with incremental_snapshot.enabled: true.

Requires version 4.82.0 or later.

Type: int

Default: 100000

snapshot_deduplicate

Deduplicate records that appear in both snapshot and CDC stream. During the snapshot, the input buffers the keys of the scanned items. It skips CDC events for those keys that are stamped more than 1 minute before the snapshot start. If the buffer is exceeded, deduplication is disabled to prevent data loss. If the host clock is more than 1 minute ahead of the AWS clock, the input can skip CDC events for writes made immediately after the snapshot start. Those writes are lost. Writes made in the minute before the snapshot start can appear as duplicates. It has no effect with incremental_snapshot.enabled: true.

Requires version 4.82.0 or later.

Type: bool

Default: true

snapshot_mode

none: Streams CDC events only (default). snapshot_only: Performs a one-time full table scan with no ongoing streaming. snapshot_and_cdc: Scans the entire table, then streams changes. snapshot_only and snapshot_and_cdc require a single table. They fail at startup with table_discovery_mode: tag, with more than one table in tables, or with signal_table_name set. To backfill while streaming, leave this at none and set incremental_snapshot.enabled: true.

Requires version 4.82.0 or later.

Type: string

Default: none

Options: none, snapshot_only, snapshot_and_cdc

snapshot_segments

Number of parallel scan segments (1-10). Higher parallelism scans faster but consumes more Read Capacity Units (RCUs). A lower value is safer to start with. A snapshot that resumes from stored progress keeps the segment count it started with. A changed value applies to the next snapshot.

Requires version 4.82.0 or later.

Type: int

Default: 1

snapshot_throttle

Minimum time between scan requests per segment. Use this to limit Read Capacity Unit (RCU) consumption during snapshot.

Requires version 4.82.0 or later.

Type: string

Default: 100ms

start_from

Where to start reading on a genuinely fresh pipeline (no checkpoint state exists yet under this checkpoint_namespace for the stream). trim_horizon starts from the oldest available record, latest starts from new records.

latest is honoured only on that first discovery: once any checkpoint state exists, shards discovered later - rotation children found by the periodic refresh, and any checkpoint-less shard after a restart - always start at trim_horizon so their backlog is never skipped. In practice a restart under latest therefore replays from each shard’s oldest retained record rather than only new records; at-least-once delivery takes precedence over the configured start position.

Type: string

Default: trim_horizon

Options: trim_horizon, latest

table_discovery_interval

Interval for rescanning and discovering new tables when using tag or includelist mode. Set to 0 to disable periodic rescanning.

Requires version 4.83.0 or later.

Type: string

Default: 5m

table_discovery_mode

single: Streams from tables specified in the tables list. tag: Auto-discovers tables by tags (ignores the tables field). includelist: Streams from tables in the tables list. Use single instead; includelist is kept for backward compatibility.

Requires version 4.83.0 or later.

Type: string

Default: single

Options: single, tag, includelist

table_tag_filter

Multi-tag filter in the format key1:v1,v2;key2:v3,v4. Matches tables where (key1=v1 OR key1=v2) AND (key2=v3 OR key2=v4). Required when table_discovery_mode is tag.

Requires version 4.83.0 or later.

Type: string

Default: ""

tables[]

List of table names to stream from. For single table mode, provide one table. For multi-table mode, provide multiple tables.

Requires version 4.83.0 or later.

Type: array<string>

Default: []

tcp

Configure TCP socket-level settings to optimize network performance and reliability. These low-level controls are useful for:

  • Unresponsive hosts: Set connect_timeout to limit how long a connection attempt can take (the default 0s sets no limit)

  • Long-lived connections: Configure keep_alive settings to detect and recover from stale connections

  • Unstable networks: Tune keep-alive probes to balance between quick failure detection and avoiding false positives

  • Linux systems with specific requirements: Use tcp_user_timeout (Linux 2.6.37+) to control data acknowledgment timeouts

Most users should keep the default values. Only modify these settings if you’re experiencing connection stability issues or have specific network requirements.

Type: object

tcp.connect_timeout

Maximum amount of time a dial will wait for a connect to complete. Zero disables.

Type: string

Default: 0s

tcp.keep_alive

TCP keep-alive probe configuration.

Type: object

tcp.keep_alive.count

Maximum unanswered keep-alive probes before dropping the connection. Zero defaults to 9.

Type: int

Default: 9

tcp.keep_alive.idle

Duration the connection must be idle before sending the first keep-alive probe. Zero defaults to 15s. Negative values disable keep-alive probes.

Type: string

Default: 15s

tcp.keep_alive.interval

Duration between keep-alive probes. Zero defaults to 15s.

Type: string

Default: 15s

tcp.tcp_user_timeout

Maximum time to wait for acknowledgment of transmitted data before killing the connection. Linux-only (kernel 2.6.37+), ignored on other platforms. When enabled, keep_alive.idle must be greater than this value per RFC 5482. Zero disables.

Type: string

Default: 0s

throttle_backoff

Time to wait when applying backpressure due to too many in-flight messages.

Type: string

Default: 100ms

Examples

Consume CDC events

Read change events from a DynamoDB table with streams enabled.

input:
  aws_dynamodb_cdc:
    tables: [my-table]
    region: us-east-1

Start from latest

Only process new changes, ignoring existing stream data.

input:
  aws_dynamodb_cdc:
    tables: [orders]
    start_from: latest
    region: us-west-2

Snapshot and CDC

Scan all existing records, then stream ongoing changes.

input:
  aws_dynamodb_cdc:
    tables: [products]
    snapshot_mode: snapshot_and_cdc
    snapshot_segments: 5
    region: us-east-1

Auto-discover tables by tag

Automatically discover and stream from all tables with a specific tag.

input:
  aws_dynamodb_cdc:
    table_discovery_mode: tag
    table_tag_filter: "stream-enabled:true"
    table_discovery_interval: 5m
    region: us-east-1

Auto-discover tables by multiple tags

Discover tables matching multiple tag criteria with OR logic per key, AND logic across keys.

input:
  aws_dynamodb_cdc:
    table_discovery_mode: tag
    table_tag_filter: "environment:prod,staging;team:data,analytics"
    table_discovery_interval: 5m
    region: us-east-1
    # Matches tables with: (environment=prod OR environment=staging) AND (team=data OR team=analytics)

Share a checkpoint table across pipelines

Give each pipeline that reads the same stream its own checkpoint_namespace so that they can share one checkpoint table without overwriting each other’s positions. A second pipeline uses the same configuration with a different namespace, such as dev-bob.

input:
  aws_dynamodb_cdc:
    tables: [orders]
    checkpoint_table: shared_dynamodb_checkpoints
    checkpoint_namespace: dev-alice
    start_from: trim_horizon
    region: us-east-1

Stream from multiple specific tables

Stream from an explicit list of tables simultaneously.

input:
  aws_dynamodb_cdc:
    table_discovery_mode: includelist
    tables:
      - orders
      - customers
      - products
    region: us-west-2

Suggested reading

For common patterns including filtering events, routing to Kafka or S3, and detecting changed fields, see the DynamoDB CDC Patterns cookbook.