AgentSkillsCN

awsflow-dynamodb

通过 awsflow 管理 Amazon DynamoDB 表与项目。创建/删除/更新表,查询与扫描数据,对项目执行 CRUD 操作,管理 TTL、备份、全局表、自动扩展以及标签。

SKILL.md
--- frontmatter
name: awsflow-dynamodb
description: Manage Amazon DynamoDB tables and items using awsflow. Create/delete/update tables, query and scan data, CRUD operations on items, manage TTL, backups, global tables, auto-scaling, and tags.

Awsflow DynamoDB

Manage DynamoDB tables and items through the awsflow DynamoDBTool.

When to Use This Skill

Use this skill when the user:

  • Asks about DynamoDB tables or items
  • Wants to query or scan DynamoDB data
  • Needs to create, update, or delete tables
  • Wants to perform CRUD operations on items (get, put, update, delete)
  • Asks about TTL, backups, global tables, or auto-scaling
  • Needs to manage table tags

Tool: DynamoDBTool

Execute DynamoDB commands. ALWAYS provide params object.

Commands

ListTables

List DynamoDB tables.

json
{ "command": "ListTables", "params": { "Limit": 100 } }

Parameters:

ParameterTypeRequiredDescription
LimitnumberNoMaximum number of tables to return
ExclusiveStartTableNamestringNoPagination start table name

DescribeTable

Get detailed information about a table.

json
{ "command": "DescribeTable", "params": { "TableName": "my-table" } }

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name

DescribeTimeToLive

Get TTL settings for a table.

json
{ "command": "DescribeTimeToLive", "params": { "TableName": "my-table" } }

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name

DescribeContinuousBackups

Get continuous backup and point-in-time recovery status.

json
{ "command": "DescribeContinuousBackups", "params": { "TableName": "my-table" } }

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name

DescribeTableReplicaAutoScaling

Get auto-scaling settings for table replicas.

json
{ "command": "DescribeTableReplicaAutoScaling", "params": { "TableName": "my-table" } }

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name

Query

Query items by primary key with optional filter expressions.

json
{
  "command": "Query",
  "params": {
    "TableName": "my-table",
    "KeyConditionExpression": "pk = :pk AND begins_with(sk, :prefix)",
    "ExpressionAttributeValues": { ":pk": { "S": "user-123" }, ":prefix": { "S": "order#" } },
    "Limit": 25
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name
KeyConditionExpressionstringYes (for Query)Key condition expression
FilterExpressionstringNoFilter expression applied after query
ExpressionAttributeValuesobjectNoExpression attribute values map (DynamoDB typed: {"S":"string"}, {"N":"123"}, {"BOOL":true})
ExpressionAttributeNamesobjectNoExpression attribute names map (for reserved words)
IndexNamestringNoSecondary index name (GSI or LSI)
SelectstringNoProjection selection (ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, COUNT, SPECIFIC_ATTRIBUTES)
LimitnumberNoMaximum items to return

Scan

Scan all items in a table with optional filter.

json
{
  "command": "Scan",
  "params": {
    "TableName": "my-table",
    "FilterExpression": "age > :minAge",
    "ExpressionAttributeValues": { ":minAge": { "N": "30" } },
    "Limit": 100
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name
FilterExpressionstringNoFilter expression
ExpressionAttributeValuesobjectNoExpression attribute values map
ExpressionAttributeNamesobjectNoExpression attribute names map
IndexNamestringNoSecondary index name
SelectstringNoProjection selection
LimitnumberNoMaximum items to return

GetItem

Get a single item by primary key.

json
{
  "command": "GetItem",
  "params": {
    "TableName": "my-table",
    "Key": { "pk": { "S": "user-123" }, "sk": { "S": "profile" } }
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name
KeyobjectYesPrimary key map (DynamoDB typed values)

PutItem

Create or replace an item.

json
{
  "command": "PutItem",
  "params": {
    "TableName": "my-table",
    "Item": { "pk": { "S": "user-123" }, "sk": { "S": "profile" }, "name": { "S": "John" } }
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name
ItemobjectYesItem attributes map (DynamoDB typed values)
ConditionExpressionstringNoCondition expression for conditional writes
ExpressionAttributeValuesobjectNoExpression attribute values
ExpressionAttributeNamesobjectNoExpression attribute names

UpdateItem

Update attributes of an existing item.

json
{
  "command": "UpdateItem",
  "params": {
    "TableName": "my-table",
    "Key": { "pk": { "S": "user-123" }, "sk": { "S": "profile" } },
    "UpdateExpression": "SET #n = :name, age = :age",
    "ExpressionAttributeNames": { "#n": "name" },
    "ExpressionAttributeValues": { ":name": { "S": "Jane" }, ":age": { "N": "25" } }
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name
KeyobjectYesPrimary key map
UpdateExpressionstringNoUpdate expression (SET, REMOVE, ADD, DELETE)
ConditionExpressionstringNoCondition expression
ExpressionAttributeValuesobjectNoExpression attribute values
ExpressionAttributeNamesobjectNoExpression attribute names
AttributeUpdatesobjectNoLegacy attribute updates map

DeleteItem

Delete an item by primary key.

json
{
  "command": "DeleteItem",
  "params": {
    "TableName": "my-table",
    "Key": { "pk": { "S": "user-123" }, "sk": { "S": "profile" } }
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTarget table name
KeyobjectYesPrimary key map
ConditionExpressionstringNoCondition expression
ExpressionAttributeValuesobjectNoExpression attribute values
ExpressionAttributeNamesobjectNoExpression attribute names

CreateTable

Create a new DynamoDB table.

json
{
  "command": "CreateTable",
  "params": {
    "TableName": "new-table",
    "KeySchema": [{ "AttributeName": "pk", "KeyType": "HASH" }, { "AttributeName": "sk", "KeyType": "RANGE" }],
    "AttributeDefinitions": [{ "AttributeName": "pk", "AttributeType": "S" }, { "AttributeName": "sk", "AttributeType": "S" }],
    "BillingMode": "PAY_PER_REQUEST"
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTable name
KeySchemaarray of objectsYesKey schema definitions (HASH and optional RANGE)
AttributeDefinitionsarray of objectsYesAttribute definitions (S, N, B)
BillingModestringNoPROVISIONED or PAY_PER_REQUEST
ProvisionedThroughputobjectNoRead/write capacity units (required for PROVISIONED)
ExpressionAttributeNamesobjectNoExpression attribute names

DeleteTable

Delete a DynamoDB table.

json
{ "command": "DeleteTable", "params": { "TableName": "old-table" } }

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTable name to delete

UpdateTable

Update table settings (billing, GSIs, etc.).

json
{ "command": "UpdateTable", "params": { "TableName": "my-table", "BillingMode": "PAY_PER_REQUEST" } }

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTable name
BillingModestringNoPROVISIONED or PAY_PER_REQUEST
ProvisionedThroughputobjectNoProvisioned throughput config
GlobalSecondaryIndexUpdatesarray of objectsNoUpdates to GSIs

UpdateTimeToLive

Enable or disable TTL on a table.

json
{
  "command": "UpdateTimeToLive",
  "params": {
    "TableName": "my-table",
    "TimeToLiveSpecification": { "AttributeName": "ttl", "Enabled": true }
  }
}

Parameters:

ParameterTypeRequiredDescription
TableNamestringYesTable name
TimeToLiveSpecificationobjectYesTTL specification with AttributeName and Enabled

ListBackups

List DynamoDB table backups.

json
{ "command": "ListBackups", "params": {} }

Parameters: None required.

ListGlobalTables

List global tables.

json
{ "command": "ListGlobalTables", "params": {} }

Parameters: None required.

ListTagsOfResource

List tags for a DynamoDB resource.

json
{ "command": "ListTagsOfResource", "params": { "ResourceArn": "arn:aws:dynamodb:..." } }

Parameters:

ParameterTypeRequiredDescription
ResourceArnstringYesTable resource ARN

Related Services

  • DynamoDB → Lambda: DynamoDB Streams trigger Lambda functions. Use LambdaTool ListEventSourceMappings to find stream-triggered functions
  • DynamoDB → CloudWatch: DynamoDB metrics (read/write capacity, throttling) are in CloudWatch Metrics
  • DynamoDB → IAM: Table access controlled by IAM policies. Use IAMTool SimulatePrincipalPolicy to test access
  • DynamoDB → CloudFormation: Tables managed by CloudFormation — use CloudFormationTool DescribeStackResources
  • DynamoDB → S3: DynamoDB backups can be exported to S3