Skip to content

Backend: Mimic Backend in LocalStack/AWS Local #1734

@Bambaclad1

Description

@Bambaclad1

The plan is to mimic the entire AWS Backend on your machine. This makes testing locally easier. A Docker container will be made, and you can use it as test backend + database. This would replicate all AWS resources e.g. DynamoDB, Lambda, S3, AWS Cognito and more.

How does it work?

  • LocalStack allows you to develop AWS applications locally.
  • With use of AWSLocal, we can mimic the architecture into LocalStack
  • Docker will be used, for managing "Sandbox Environment". We are not using the LocalStack CLI, because that doesn't give an Docker compose, and starting manually tends to be faster.
  • A Powershell script is made which mimics the AWS Resources.

What are the benefits?

  • Easier local testing
  • Faster development, no deploying is done thus no wait-time for deploying resources.
  • Isolates from production. Any changes local will not affect the database, only locally.
  • Cost efficient. Everything will run local, so no AWS Cloud services are used.
  • Complete control over resources. You can tweak, modify anything without affecting production.

What has to be added?

  • AppSync
  • Lambda
  • Amplify - pull Domits APP Id in AWSLocal? Not implemented yet, base setup is though.
  • API Gateway base mimicking exists, have to look at what to add in it. -
  • DynamoDB
  • Route 53
  • S3 Buckets
  • Cognito
  • IAM
  • CloudWatch
  • Next.js? (No idea where this is being used.)

What are the requirements?

  • Localstack Web Application account & Activating your Hobby License (for now) on LocalStack, and input the Auth Token in the Compose. Looking to find a user friendly way of asking the user for this.
  • Docker installed, up and running
  • Python 3.11+ and pip
  • AWS CLI & awslocal (pip packages)
  • PowerShell 7+

The process will be automated, while also keeping clean code in mind. While this is my first time working with Powershell, one of the goals which i want to achieve with this script is to automate the process of installing Powershell 7.x, Python 3.11, pip, and the docker.

As of 2-4-2025, you can download it and use the script for yourself. Feel free to extend on it, and send it as comment. As of now, this is a slightly lower priority due to the main priority being the CRS.
Localstack Script

Metadata

Metadata

Assignees

Labels

ResearchResearch for future issues

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions