Skip to main content

aws-dynamodb

Query and manage AWS DynamoDB tables and items.

来源信息

仓库
ThinkfleetAI/thinkfleet-engine
最近来源活动
2026年2月1日 16:21
检测到的 SKILL.md 语言
英语
星标
0
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
aws-dynamodb
description
Query and manage AWS DynamoDB tables and items.
metadata
{"thinkfleetbot":{"emoji":"⚙️","requires":{"bins":"[Truncated]","env":"[Truncated]"}}}
# AWS DynamoDB Query and manage DynamoDB tables. ## List tables ```bash aws dynamodb list-tables --output table ``` ## Describe table ```bash aws dynamodb describe-table --table-name my-table | jq '{TableName: .Table.TableName, Status: .Table.TableStatus, ItemCount: .Table.ItemCount, SizeBytes: .Table.TableSizeBytes, KeySchema: .Table.KeySchema, BillingMode: .Table.BillingModeSummary.BillingMode}' ``` ## Get item ```bash aws dynamodb get-item --table-name my-table \ --key '{"pk": {"S": "user#123"}, "sk": {"S": "profile"}}' | jq '.Item' ``` ## Query items ```bash aws dynamodb query --table-name my-table \ --key-condition-expression "pk = :pk" \ --expression-attribute-values '{":pk": {"S": "user#123"}}' \ --query 'Items[*]' | jq . ``` ## Query with filter ```bash aws dynamodb query --table-name my-table \ --key-condition-expression "pk = :pk AND begins_with(sk, :prefix)" \ --expression-attribute-values '{":pk": {"S": "user#123"}, ":prefix": {"S": "order#"}}' \ --query 'Items[*]' | jq . ``` ## Scan table (use carefully) ```bash aws dynamodb scan --table-name my-table --max-items 10 | jq '{Count, ScannedCount, Items: .Items[:3]}' ``` ## Put item ```bash aws dynamodb put-item --table-name my-table \ --item '{"pk": {"S": "user#456"}, "sk": {"S": "profile"}, "name": {"S": "John"}, "email": {"S": "john@example.com"}}' echo "Item written" ``` ## Delete item ```bash aws dynamodb delete-item --table-name my-table \ --key '{"pk": {"S": "user#456"}, "sk": {"S": "profile"}}' echo "Item deleted" ``` ## Table metrics ```bash aws cloudwatch get-metric-statistics --namespace AWS/DynamoDB \ --metric-name ConsumedReadCapacityUnits --dimensions Name=TableName,Value=my-table \ --start-time $(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \ --period 300 --statistics Sum --output table ``` ## Notes - Prefer `query` over `scan`; scans read every item and are expensive. - DynamoDB uses typed attributes (`S` for string, `N` for number, `B` for binary, etc.). - Confirm before writing or deleting items.
在 GitHub 查看