Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for YDB
  • Getting started
  • Access management
      • Setting up AWS tools
      • Data operations through the HTTP interface
        • Overview
        • Creating a table
        • Adding data to a table
        • Reading data from a table
        • Updating data
        • Data selection
        • Deleting the resources you created
    • Common errors when using the Document API
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials
  1. Amazon DynamoDB-compatible Document API
  2. Tools
  3. Working with the AWS CLI
  4. Creating a table

Creating a table in the AWS CLI

Written by
Yandex Cloud
Updated at April 24, 2026
View in Markdown
AWS CLI

Warning

To work with the AWS CLI on Windows, we recommend using the WSL.

If you do not have the AWS CLI yet, install and configure it.

To create a series table with a series number partition key and a series title sort key:

  1. Prepare the Document API endpoint and specify it:

    endpoint=<your_DB_endpoint>
    
  2. Run this command:

    aws dynamodb create-table \
      --table-name <table_name> \
      --attribute-definitions \
        AttributeName=<series_number>,AttributeType=N \
        AttributeName=<series_title>,AttributeType=S \
        AttributeName=<series_description>,AttributeType=S \
        AttributeName=<series_release_date>,AttributeType=S \
      --key-schema \
        AttributeName=<series_number>,KeyType=HASH \
        AttributeName=<series_title>,KeyType=RANGE \
      --endpoint $endpoint
    

    Where:

    • --table-name: Table name.
    • --attribute-definitions: Description of item attributes, consisting of AttributeName and AttributeType, which can be:
      • N: Number
      • S: String
      • B: Binary
    • --key-schema: Key schema for the table, where AttributeName is the key attribute name, and KeyType can be:
      • HASH: Partition key.
      • RANGE: Sort key.

    The key-schema attributes should also be defined in the attribute-definitions array.

ExampleExample

To create a table named series with the series_id partition key and title sort key:

endpoint="your-database-endpoint"
aws dynamodb create-table \
  --table-name series \
  --attribute-definitions \
    AttributeName=series_id,AttributeType=N \
    AttributeName=title,AttributeType=S \
    AttributeName=series_info,AttributeType=S \
    AttributeName=release_date,AttributeType=S \
  --key-schema \
    AttributeName=series_id,KeyType=HASH \
    AttributeName=title,KeyType=RANGE \
  --endpoint $endpoint

Result:

{
    "TableDescription": {
        "AttributeDefinitions": [
            {
                "AttributeName": "series_id",
                "AttributeType": "N"
            },
            {
                "AttributeName": "title",
                "AttributeType": "S"
            },
            {
                "AttributeName": "series_info",
                "AttributeType": "S"
            },
            {
                "AttributeName": "release_date",
                "AttributeType": "S"
            }
        ],
        "TableName": "series",
        "KeySchema": [
            {
                "AttributeName": "series_id",
                "KeyType": "HASH"
            },
            {
                "AttributeName": "title",
                "KeyType": "RANGE"
            }
        ],
        "TableStatus": "ACTIVE",
        "CreationDateTime": "2020-12-27T13:21:10+00:00",
        "TableSizeBytes": 0,
        "ItemCount": 0
    }
}

Was the article helpful?

Previous
Overview
Next
Adding data to a table
© 2026 Direct Cursus Technology L.L.C.