Since I am now an Amazonian, I thought it would be a good time to start learning how to use our technologies. So, here it is: the first instalment in my new, occasional series, which I am tentatively calling “AWS via Haskell”. In these posts we’ll do AWS stuff using our programming language of choice, i.e. Haskell. I will build these examples on top of the awesome and comprehensive amazonka family of packages by Brendan Hay.
Today, I’ll talk about how to do some basic tasks with DynamoDB.
You’ll need access to a DynamoDB instance. The two most common ways of doing this are as follows:
dynamodb-demo.cabal: the dependencies
This examples use the following standard Haskell packages which do not require additional explanation:
In addition, we depend on the following amazonka packages:
amazonka: connection and credential handling etc.
amazonka-dynamodb: DynamoDB-specific APIs
Main.hs: the code
This simple program demonstrates the core tasks you’ll most likely find yourself doing with DynamoDB:
The things of most note are as follows:
All content © 2018 Richard Cook. All rights reserved.