Quick Setup localstack on Windows 10

What is Localstack?

Localstack is a fully functional local cloud stack. LocalStack provides an easy-to-use test/mocking framework for developing Cloud applications. It spins up a testing environment on your local machine that provides the same functionality and APIs as the real AWS cloud environment.

We can run Lambda functions, store data to DynamoDB tables, feed events through Kinesis streams, put your application behind an API Gateway, and much more. And all this happens on your local machine, without ever talking to the cloud. Check out the Github repository.

Some of the benefits of using localstack

  • Enables a highly efficient dev&test loop. Deploy your application locally in Docker, within seconds
  • Its huge cost savings for development teams of all sizes. No cloud infrastructure needed
  • This Improve software quality through continuous integration. Stop rolling out untested changes.

Steps to install localstack

Prerequisite:

  • Create a file with the name docker-compose.yml.
  • Copy the below and paste it into a docker-compose.yml.
version: "3.8"

services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack
    network_mode: bridge
    ports:
      - "127.0.0.1:53:53"                # only required for Pro
      - "127.0.0.1:53:53/udp"            # only required for Pro
      - "127.0.0.1:443:443"              # only required for Pro
      - "127.0.0.1:4510-4530:4510-4530"  # only required for Pro
      - "127.0.0.1:4566:4566"
      - "127.0.0.1:4571:4571"
    environment:
      - SERVICES=${SERVICES-}
      - DEBUG=${DEBUG-}
      - DATA_DIR=${DATA_DIR-}
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
      - LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY-}  # only required for Pro
      - HOST_TMP_FOLDER=${TMPDIR:-/tmp/}localstack
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${TMPDIR:-/tmp}/localstack:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
  • In case the formatting is not proper the same can be downloaded from here.
  • Open PowerShell from the folder where above docker-compose.yml is kept.
  • Run docker-compose up command.
  • Builds, (re)creates, starts, and attaches to containers for all LocalStack services.
  • Now you can work with Localstack services like S3.
%d bloggers like this: