LoginSignup
15
15

More than 5 years have passed since last update.

DynamoDB AWS CLI

Last updated at Posted at 2014-05-28

テーブルの一覧

list-tables を使います。

<コマンド>

$ aws dynamodb list-tables

<出力>

{
    "TableNames": [
        "table_name_1", 
        "table_name_2", 
        "table_name_3"
    ]
}

テーブルの作成

create-table を使います。

<コマンド>

$ aws dynamodb create-table  --table-name sample_table \
--attribute-definitions AttributeName=some_id,AttributeType=S AttributeName=some_time,AttributeType=S \
--key-schema AttributeName=some_id,KeyType=HASH AttributeName=some_time,KeyType=RANGE \
--provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1

テーブルの詳細表示

describe-table を使います。

<コマンド>

$ aws dynamodb describe-table --table-name=sample_table

<出力>

{
    "Table": {
        "AttributeDefinitions": [
            {
                "AttributeName": "some_id", 
                "AttributeType": "S"
            }, 
            {
                "AttributeName": "some_time", 
                "AttributeType": "S"
            }
        ], 
        "ProvisionedThroughput": {
            "NumberOfDecreasesToday": 0, 
            "WriteCapacityUnits": 1, 
            "ReadCapacityUnits": 1
        }, 
        "TableSizeBytes": 0, 
        "TableName": "sample_table", 
        "TableStatus": "ACTIVE", 
        "KeySchema": [
            {
                "KeyType": "HASH", 
                "AttributeName": "some_id"
            }, 
            {
                "KeyType": "RANGE", 
                "AttributeName": "some_time"
            }
        ], 
        "ItemCount": 0, 
        "CreationDateTime": 1401293991.7019999
    }
}

コマンド一覧

$ aws dynamodb help
AVAILABLE COMMANDS
       o batch-get-item
       o batch-write-item
       o create-table
       o delete-item
       o delete-table
       o describe-table
       o get-item
       o help
       o list-tables
       o put-item
       o query
       o scan
       o update-item
       o update-table

参考

  1. http://docs.aws.amazon.com/cli/latest/reference/dynamodb/
  2. http://blog.cloudpack.jp/2014/04/10/aws-news-sqs-dynamodb-cli/
15
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
15