Running AWS locally with LocalStack

More and more companies are switching over to cloud native. As a developer this gives me a lot of services to create awesome applications. The one challenge that occurred to me right away was how to use all those new components during development. Since some companies do not have a testing/development environment in their cloud provider to play with. This was when LocalStack piqued my interest to simulate an AWS environment locally on my laptop or when running the CI/CD pipeline.

By Thomas de Groot

This blog will give a brief introduction in what LocalStack can do and how you can use it for your own projects.

What is LocalStack

LocalStack is a fully functional local AWS cloud stack that makes mocking/testing cloud applications simple by having everything start up local. With starting up LocalStack you are able to start up some core features of AWS like S3, DynamoDB, SNS/SQS and many more.

A single Docker container to rule them all

LocalStack can be started within a single docker container. It has quite some possibilities to edit some of the config. By setting the right environment variables you are able configure what service you want to enable and for some you can even set a random error rate for development purposes. The single container will be the host of the LocalStack application, to be able to reach certain services you need to address single edge service of LocalStack that is exposed by port 4566.

The edge serivce API of LocalStack is introduced by version 0.11.0. In previouse versions of LocalStack you needed to address a different port for each specific service (see here for the overview). Be warned the API-specific services may be removed in the future.