← 返回命令列表

Linux command

aws-dynamodb 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create a table

aws dynamodb create-table --table-name [my-table] --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST

Put an item

aws dynamodb put-item --table-name [my-table] --item '{"id": {"S": "[item-id]"}, "name": {"S": "[value]"}}'

Get an item

aws dynamodb get-item --table-name [my-table] --key '{"id": {"S": "[item-id]"}}'

Query items

aws dynamodb query --table-name [my-table] --key-condition-expression "id = :id" --expression-attribute-values '{":id": {"S": "[item-id]"}}'

Scan all items

aws dynamodb scan --table-name [my-table]

Update an item

aws dynamodb update-item --table-name [my-table] --key '{"id": {"S": "[item-id]"}}' --update-expression "SET #n = :val" --expression-attribute-names '{"#n": "name"}' --expression-attribute-values '{":val": {"S": "[new-value]"}}'

Delete an item

aws dynamodb delete-item --table-name [my-table] --key '{"id": {"S": "[item-id]"}}'

说明

aws dynamodb is the AWS CLI interface for Amazon DynamoDB, a fully managed NoSQL key-value and document database. DynamoDB provides single-digit millisecond performance at any scale with built-in security, backup, and in-memory caching. Tables store items identified by primary keys (partition key, or partition + sort key). DynamoDB supports on-demand and provisioned capacity modes, global tables for multi-region replication, and transactions for ACID operations.

FAQ

What is the aws-dynamodb command used for?

aws dynamodb is the AWS CLI interface for Amazon DynamoDB, a fully managed NoSQL key-value and document database. DynamoDB provides single-digit millisecond performance at any scale with built-in security, backup, and in-memory caching. Tables store items identified by primary keys (partition key, or partition + sort key). DynamoDB supports on-demand and provisioned capacity modes, global tables for multi-region replication, and transactions for ACID operations.

How do I run a basic aws-dynamodb example?

Run `aws dynamodb create-table --table-name [my-table] --attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more aws-dynamodb examples?

This page includes 7 examples for aws-dynamodb, plus related commands for nearby Linux tasks.