AWS

DynamoDBResourceNotFoundException - DynamoDB Resource Not Found

Getting a **DynamoDBResourceNotFoundException** means the DynamoDB table, index, or stream you're referencing doesn't exist—the resource might have been deleted, the name is misspelled, or it's in a different region. This client-side error (4xx) happens when AWS validates DynamoDB resource existence. Most common when table names are misspelled, but also appears when tables don't exist, tables are deleted, incorrect regions are specified, or indexes/streams are not found.

#Common Causes

  • Identity: IAM policy allows DynamoDB access but resource doesn't exist. Service Control Policy (SCP) restricts resource access.
  • Network: VPC endpoint DynamoDB resource restrictions. Cross-region resource access.
  • Limits: Table name misspelled. Table does not exist. Table deleted. Incorrect region specified. Index or stream not found.

Solutions

  1. 1Step 1: Diagnose - List all DynamoDB tables: aws dynamodb list-tables --output table. Check if table exists. Verify table name spelling.
  2. 2Step 2: Diagnose - Check table in specific region: aws dynamodb describe-table --table-name TABLE_NAME --region REGION. Verify region is correct. Check if table exists in that region.
  3. 3Step 3: Diagnose - Search for similar table names: aws dynamodb list-tables --query "TableNames[?contains(@, 'PARTIAL_NAME')]" --output table. Find correct table name.
  4. 4Step 4: Fix - Use correct table name: Verify table name from list. Check for typos. Use exact table name (case-sensitive). Verify table ARN if using ARN.
  5. 5Step 5: Fix - Check if table was deleted: Review CloudTrail logs: aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=DeleteTable. Or check table status: aws dynamodb describe-table --table-name TABLE_NAME.

</>Code Examples

List All DynamoDB Tables to Find Correct Name
1#!/bin/bash
2echo "=== All DynamoDB Tables ==="
3aws dynamodb list-tables --output table
4
5# Search for specific table
6TABLE_NAME="my-table"
7echo "\n=== Searching for Table: ${TABLE_NAME} ==="
8aws dynamodb list-tables \
9  --query "TableNames[?contains(@, 'my')]" \
10  --output table
11
12# Check if exact table exists
13echo "\n=== Checking Exact Table ==="
14if aws dynamodb describe-table --table-name ${TABLE_NAME} &>/dev/null; then
15  echo "✓ Table ${TABLE_NAME} exists"
16  aws dynamodb describe-table --table-name ${TABLE_NAME} \
17    --query 'Table.[TableName,TableStatus,ItemCount,TableSizeBytes]' \
18    --output table
19else
20  echo "✗ Table ${TABLE_NAME} not found"
21  echo "\nSimilar table names:"
22  aws dynamodb list-tables \
23    --query "TableNames[?contains(@, 'my')]" \
24    --output table
25fi
Check DynamoDB Table Across Regions
1#!/bin/bash
2TABLE_NAME="my-table"
3
4echo "=== Checking Table Across Regions ==="
5REGIONS=("us-east-1" "us-west-2" "eu-west-1" "ap-southeast-1")
6
7for REGION in "${REGIONS[@]}"; do
8  echo "\nChecking region: ${REGION}"
9  RESULT=$(aws dynamodb list-tables \
10    --region ${REGION} \
11    --query "TableNames[?@=='${TABLE_NAME}']" \
12    --output text 2>/dev/null)
13  
14  if [ ! -z "${RESULT}" ]; then
15    echo "✓ Table found in ${REGION}: ${RESULT}"
16    
17    # Get table details
18    aws dynamodb describe-table \
19      --table-name ${TABLE_NAME} \
20      --region ${REGION} \
21      --query 'Table.[TableName,TableStatus,ItemCount]' \
22      --output table
23    break
24  else
25    echo "✗ Table not found in ${REGION}"
26  fi
27done
Check Table Status and Wait for Active
1#!/bin/bash
2TABLE_NAME="my-table"
3
4echo "=== Checking Table Status ==="
5TABLE_STATUS=$(aws dynamodb describe-table \
6  --table-name ${TABLE_NAME} \
7  --query 'Table.TableStatus' \
8  --output text 2>&1)
9
10if [ $? -eq 0 ]; then
11  echo "Table status: ${TABLE_STATUS}"
12  
13  if [ "${TABLE_STATUS}" = "ACTIVE" ]; then
14    echo "✓ Table is active and ready"
15  elif [ "${TABLE_STATUS}" = "CREATING" ]; then
16    echo "⏳ Table is being created"
17    echo "Waiting for table to be active..."
18    aws dynamodb wait table-exists --table-name ${TABLE_NAME}
19    echo "✓ Table is now active"
20  elif [ "${TABLE_STATUS}" = "DELETING" ]; then
21    echo "✗ Table is being deleted"
22  else
23    echo "Table status: ${TABLE_STATUS}"
24  fi
25else
26  echo "✗ Table ${TABLE_NAME} not found"
27  echo "Error: ${TABLE_STATUS}"
28fi

Related Errors

Provider Information

This error code is specific to AWS services. For more information, refer to the official AWS documentation.

DynamoDBResourceNotFoundException - DynamoDB Resource Not Found | AWS Error Reference | Error Code Reference