API documentation

This is the API documentation for DynamoDB Config Store.


class dynamodb_config_store.DynamoDBConfigStore(connection, table_name, store_name, store_key='_store', option_key='_option', read_units=1, write_units=1, config_store='SimpleConfigStore', config_store_args=[], config_store_kwargs={})[source]

DynamoDB Config Store instance

_create_table(read_units=1, write_units=1)[source]

Create a new table

  • read_units (int) – Number of read capacity units to provision
  • write_units (int) – Number of write capacity units to provision

bool – Returns True if the table was created


Initialize the store to use


Initialize the table

_wait_for_table(target_state, sleep_time=5, retries=30)[source]

Wait for the table to get to a certain state

  • target_state (str) – The target state to wait for
  • sleep_time (int) – Number of seconds to wait between the checks
  • retries (int) – Number of retries before giving up

bool – True if the target state was reached, else False


Reload the config store

set(option, data)[source]

Upsert a config item

A write towards DynamoDB will be executed when this method is called.

  • option (str) – Name of the configuration option
  • data (dict) – Dictionary with all option data

bool – True if the data was stored successfully



This is the ConfigStore base class that all other config stores inherit from.

class dynamodb_config_store.config_stores.ConfigStore[source]

Base class for config stores


Delete all the instance attributes


Set instance attributes

Parameters:options (dict) – Dict with {‘option’: {‘key’: ‘value’}}


The DirectConfigStore is the default Config Store. All requests made will be send directly to DynamoDB so that the latest configuration is fetched at all times.


The TimeBasedConfigStore is a Config Store used for fetching configuration from DynamoDB on a preset interval. All configuration options will be exposed using instance attributes such as store.config.option, where option is the store option.

This class shall not be instanciated directly, it’s called by DynamoDBConfigStore.

class dynamodb_config_store.config_stores.time_based.TimeBasedConfigStore(table, store_name, store_key, option_key, update_interval=300)[source]

Fetches Stores on a periodic interval from DynamoDB

All internal variables and methods are private (with an leading _), as the configuration options from DynamoDB will be set as instance attributes.


Retrieve a dictionary with all options and values from DynamoDB

Returns:dict – Dict with {‘option’: {‘key’: ‘value’}}

Run periodic fetcher



Exception definitions

exception dynamodb_config_store.exceptions.MisconfiguredSchemaException[source]

Exception thrown if the table does not match the configuration

exception dynamodb_config_store.exceptions.TableNotCreatedException[source]

Exception thrown if the table could not be created successfull

exception dynamodb_config_store.exceptions.TableNotReadyException[source]

Exception thrown if the table is not in ACTIVE or UPDATING state