LocalStack : AWS on Local Desktop

Posted in Recipe on July 11, 2022 by Venkatesh S ‐ 2 min read


In a typical application development lifecycle, I usually see that majority of the times certain AWS cloud services are always involved. I typically use them in these scenarios

  • When I run the dev and test loops locally, or as a part of CI cycle, I always find localstack to be very useful. Its just a container of localstack that needs to be brought up and torn down after everything is done.

  • I do not need to worry about any cloud infrastructure when building the application.

  • Helps in cost reduction as all your services are running locally.

LocalStack provides an easy-to-use framework for developing Cloud applications. It spins up a mocked cloud environment on your local machine that provides the same functionality and APIs as the real AWS cloud environment.

You can run your Lambda functions, store contents on S3 buckets, store data to DynamoDB tables, feed events through Kinesis streams, put your application behind an API Gateway, and a lot of other services can be used. And all this happens on your local machine, without ever talking to the cloud.

As per the website, here is a suggested model for using local stack in local development machine, integration environments and then how you can move applications on production that uses the real AWS services.

architecture

Setting up LocalStack is very simple. While there are many ways of setting it up, a local CLI, docker container, Kubernetes deployment, I would suggest using LocalStack Cockpit for very easily setting it up. Ensure that you have docker running locally and download the binary and bring up the UI as simple as this.

Check https://localstack.cloud/products/cockpit/ for more details on the installation process.

The UI looks like this.