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 dependenciesThis examples use the following standard Haskell packages which do not require additional explanation:
bytestring
lens
resourcet
text
unordered-containers
In addition, we depend on the following amazonka packages:
amazonka
: connection and credential handling etc.amazonka-dynamodb
: DynamoDB-specific APIsMain.hs
: the codeThis simple program demonstrates the core tasks you’ll most likely find yourself doing with DynamoDB:
The things of most note are as follows:
HashMap
sI’ve gathered this all together into this buildable project. As always, I like to build using Stack.
Content © 2024 Richard Cook. All rights reserved.