cpat431
cpat431

Reputation: 5

Create a table in dynamodb with read and write capacity unit to be provisioned with auto scaling in Python

I am trying to create a dynamodb table with python and below is my code but how to keep ProvisionedThroughput readcapacity and writecapacity with auto scaling


 table = dynamodb_client.create_table(
    TableName=table_name,
    KeySchema=[
        {
            'AttributeName': 'DeviceID',
            'KeyType': 'HASH'  #Partition key
        },
        {
            'AttributeName': 'Timestamp',
            'KeyType': 'RANGE'  #Sort key
        }
    ],
    AttributeDefinitions=[
        {
            'AttributeName': 'DeviceID',
            'AttributeType': 'S'
        },
        {
            'AttributeName': 'Timestamp',
            'AttributeType': 'N'
        },

    ],

    )

Upvotes: 0

Views: 250

Answers (1)

Marcin
Marcin

Reputation: 238081

You have to setup ApplicationAutoScaling, as autoscaling in DynamoDB is managed by Application AutoScaling. This is done using entire different set of boto3 commands, e.g. put_scaling_policy.

Upvotes: 1

Related Questions