Member-only story
How to use LocalStack to simulate AWS services on your local machine and use Terraform or CLI to interact
While developing applications for AWS, I always feel that it will be easier to test something before I deploy to AWS and use up billing. I have come across many solutions and examples to do local testing for the applications or services built for AWS. But one of those solutions which I found very useful was Localstack. Once I learnt about Localstack, I have been using it for all my testing. I have found it very easy to test a service deployment locally before actually deploying to AWS. This also helps with accruing billing for something which I just want to test and make sure its working.
In this post, we will delve into the fundamentals of LocalStack, its key features, and the benefits it offers. Whether you’re a seasoned AWS professional or just starting, understanding LocalStack’s capabilities can significantly streamline your development process, reduce costs, and enhance your overall productivity.
All the code I show here, can be found in this Github Repo:
https://github.com/amlana21/localstack-post-publish
Pre-requisites
Before I start the walkthroughs, let me list out some pre-requisites, if you want to install and run this on your own
- Python (3.7 and higher) installed
- Docker installed
- A free account on https://app.localstack.cloud/
That should cover what’s needed to run it locally. The last point of getting a free account is an optional step and can be skipped. The localstack will still work locally with some limitations on some services.
What is AWS?
If you are a beginner and wondering what exactly is AWS and how is that useful to you, let me briefly explain what it is. Amazon Web Services, commonly known as AWS, is a comprehensive and widely adopted cloud platform offered by Amazon. It provides a vast array of services and infrastructure solutions that cater to computing, storage, databases, machine learning, analytics, and much more. AWS is renowned for its flexibility, scalability, and cost-effectiveness, making it a preferred choice for businesses of all sizes, from…