DEV Community

Cover image for Simplifying Local AWS Development with LocalStack
Faruq Abdulsalam
Faruq Abdulsalam

Posted on • Edited on

Simplifying Local AWS Development with LocalStack

So far in my career, I have developed several noteworthy full-stack applications utilizing AWS services, with the applications themselves hosted on AWS. Often, I’ve had to set up a local demo account on AWS to leverage several services in free-tier mode during development. These services include S3 for data storage, Cognito for authentication, API Gateway, AWS Lambda, Elastic Container Repository, Certificate Manager, Simple Email Service (SES), and Simple Notification Service (SNS), among many others. The list is endless.

To test how the application would behave in a live environment, I’d also need to set up EC2 instances (app servers), CloudWatch for alarms and logs, and EventBridge for task scheduling. This made me question whether this can still be called "local development." After all, we’re relying on live AWS services, and we can’t fully validate how everything will work until it’s in the staging environment.

On a recent project, we had several Lambda functions that needed to be validated before deployment. To make testing easier, we mocked the API Gateway using the FastAPI framework to invoke the Lambda functions. This approach allowed us to test each Lambda function during development. However, we ran into a frustrating bug (the infamous "But it works fine on my system" issue). The cause? Our local API Gateway environment had different settings from the cloud environment. I genuinely believe that if we had an option to mock the AWS services exactly as they are, we could have avoided this issue.

Recently, I discovered LocalStack, a cloud development platform that addresses exactly the challenges I’ve been facing. To my surprise, it’s been around since 2016. That made me feel like I’d been living under a rock, but at the same time, there’s so much to explore in the world of tech. It’s impossible to know every tool out there — but staying curious and exploring the ones you need as you come across them is key.

Since discovering LocalStack, I’ve been testing out its services, and I can honestly say it’s been a series of "wow" moments. "Wow, that was fast," "Wow, I can actually do this locally," and "Wow, this could really save me time!" It’s been exciting to see how LocalStack can replicate AWS services locally with such ease.

Because of this, I’ve decided to create a series that walks through how to use each service offered by LocalStack. By combining the steps in this series with LocalStack’s documentation, I believe you’ll be able to truly keep your local development, well, local (pun intended!). This way, you can work more efficiently and avoid the pitfalls I’ve encountered.

Top comments (0)