Today, in “AWS via Haskell”, we’ll quickly look at accessing AWS SQS (Simple Queue Service) after looking at S3 yesterday.

Part 1: Prerequisites

Firstly, you’ll need access to SQS. There are several options:

Create an AWS account and use the real S3 service in the cloud: you can start with the free tier and go from there

Install localstack

Part 2: aws-via-haskell.cabal : the dependencies

You’ll see that our s3-app target depends on the following

amazonka-sqs

base

We’ll also use some of the helper functions in our shared AWSInfo.hs module.

Part 3: Main.hs : the code

This program demonstrates how to:

Create a queue

List queues

Get queue URLs

Send messages

Receive messages

Part 4: The full working demo project

I’ve gathered this all together into this buildable project. As always, I like to build using Stack.

Part 5: Related posts