dynamodb_update_ttl
Configure Time to Live (TTL) settings for DynamoDB tables to automatically expire items after a specified duration, managing data lifecycle and storage costs.
Instructions
Update the TTL settings for a table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | Name of the DynamoDB table | |
| ttl_enabled | Yes | Whether TTL should be enabled | |
| ttl_attribute | Yes | The attribute name to use for TTL |
Implementation Reference
- src/mcp_server_aws/server.py:212-219 (handler)The core handler logic for the 'dynamodb_update_ttl' tool, which invokes the AWS DynamoDB client's update_time_to_live method with the provided table name, TTL enabled status, and attribute.elif name == "dynamodb_update_ttl": response = dynamodb_client.update_time_to_live( TableName=arguments["table_name"], TimeToLiveSpecification={ 'Enabled': arguments["ttl_enabled"], 'AttributeName': arguments["ttl_attribute"] } )
- src/mcp_server_aws/tools.py:401-422 (schema)Input schema and Tool definition for 'dynamodb_update_ttl', specifying parameters: table_name (string), ttl_enabled (boolean), ttl_attribute (string).Tool( name="dynamodb_update_ttl", description="Update the TTL settings for a table", inputSchema={ "type": "object", "properties": { "table_name": { "type": "string", "description": "Name of the DynamoDB table" }, "ttl_enabled": { "type": "boolean", "description": "Whether TTL should be enabled" }, "ttl_attribute": { "type": "string", "description": "The attribute name to use for TTL" } }, "required": ["table_name", "ttl_enabled", "ttl_attribute"] } ),
- src/mcp_server_aws/server.py:136-140 (registration)Tool registration via the MCP list_tools handler, which returns get_aws_tools() containing the 'dynamodb_update_ttl' Tool object.async def list_tools() -> list[Tool]: """List available AWS tools""" logger.debug("Handling list_tools request") return get_aws_tools()