LocalStack – AWS Emulator

LocalStack is a cloud service emulator that can run on your local and gives most of what AWS cloud offers for development. You can develop code in your local, test it end to end without need of connecting to AWS. Atleast this is why I went on installing LocalStack on my machine. So far I am able to test SQS and Lambda, and it is pretty promising. 🙂

Lets see how to install LocalStack first.

Pre-requisites

I am using docker to run LocalStack since it is easy to cleanup. Make sure you install docker before continuing with next steps.

Also you need python inorder to install LocalStack.

LocalStack Installation

I had python on my machine. So I went with the following command.

python -m pip install localstack

Once done install awslocal cli. You may need to do it with elevated permission.

pip install awscli-local[ver1]

Starting LocalStack

Lets now start LocalStack with the following command. Make sure docker is running.

localstack start -d

You should see the following in the command prompt.

Validation

Lets create a SQS queue and see if it works. Execute the following command.

awslocal sqs create-queue --queue-name sample-queue
{
"QueueUrl": "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/sample-queue"
}

Lets now list the queues and see queue is created from the above command.

awslocal sqs list-queues

You should see the queue.

Do I Have a UI?

Yes. There is a UI to navigate across components just like in AWS console. I downloaded it from Microsoft Store since I am using Windows 11.

Configuring LocalStack Desktop

When you open the LocalStack desktop, you will see the link

Select the link. Then enter the following endpoint.

http://localhost:4566

You will be asked to login by creating account on LocalStack. After logging in you should see the dashboard.

Some of the features are Pro features which needs to be purchased. But majority are still open to use.

Lets now select SQS in the dashboard to look at our created queue. You will see the created queue as shown below.

Closing Note

Running and testing the program on local is much much faster than on the cloud. LocalStack can significantly reduce the turn around time of building quality AWS program or architecture. I see LocalStack even support writing program with AWS CDK. I have not gone too far in it. I am impressed.

Leave a comment