aws-dynamodb
Interact with Amazon DynamoDB from the command line
TLDR
Create a table
List all tables in the DynamoDB
Get details about a specific table
Add an item to a table
Retrieve an item from a table
Update an item in the table
Scan items in the table
Delete an item from the table
SYNOPSIS
aws dynamodb SUBCOMMAND [--table-name NAME] [--region REGION] [OPTIONS]
PARAMETERS
--table-name (string)
Name of the DynamoDB table
--key (structure)
Primary key of the item in JSON format
--item (structure)
Item attributes to put or update in JSON
--region (string)
AWS Region (e.g., us-east-1)
--endpoint-url (string)
Override AWS service endpoint
--profile (string)
Named profile from AWS config
--output (string)
Output format: json|text|table
--query (string)
JMESPath query to filter output
--cli-input-json (string)
Perform operation from JSON file
--generate-cli-skeleton (string)
Print JSON skeleton for input
--debug
Enable debug logging
--condition-expression (string)
Conditional expression for writes
--projection-expression (string)
Attributes to retrieve
--filter-expression (string)
Filter for scan or query
--limit (integer)
Max number of items to evaluate
DESCRIPTION
The aws dynamodb command is a core component of the AWS Command Line Interface (CLI), enabling direct interaction with Amazon DynamoDB, a fully managed, serverless NoSQL database service.
It supports a wide range of operations including creating and managing tables, inserting, retrieving, updating, and deleting items, as well as querying and scanning data. Subcommands handle schema definitions with primary keys, attributes, throughput settings, global secondary indexes (GSI), local secondary indexes (LSI), and streams.
Data is exchanged in JSON format, supporting native types like strings, numbers, binaries, lists, maps, sets, booleans, and nulls. Batch operations allow efficient handling of multiple items. Conditional expressions enable atomic, optimistic concurrency control.
Ideal for automation, scripting, data migration, testing with DynamoDB Local, and integration in DevOps pipelines. Output formats include JSON, text, or table for parsing with tools like jq. All actions require AWS credentials configured via IAM roles, access keys, or profiles, and incur standard DynamoDB pricing based on read/write capacity units and storage.
Usage requires AWS CLI v2 recommended for performance gains over v1. Global options control verbosity, pagination, and endpoints.
CAVEATS
Requires AWS CLI installed/configured with credentials; operations billed by AWS; large scans/queries consume read capacity; pagination needed for big result sets; JSON input must match DynamoDB types exactly.
KEY SUBCOMMANDS
create-table, delete-table, describe-table, get-item, put-item, update-item, delete-item, batch-get-item, batch-write-item, query, scan, list-tables.
INSTALLATION
curl 'https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip' | unzip -; sudo ./aws/install --bin-dir /usr/local/bin
EXAMPLES
Get item: aws dynamodb get-item --table-name Users --key '{"id":{"S":"123"}}'
Create table: aws dynamodb create-table --table-name Test --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
HISTORY
Introduced in AWS CLI v1 (March 2013) alongside DynamoDB launch; enhanced in v2 (2020) with faster execution, modular design, and better JSON handling; ongoing updates track DynamoDB features like on-demand capacity (2018) and PartiQL support.


