How to Develop and test AWS cloud and server-less apps offline without any cost
Most of the developers must have faced the challenges to develop,integrate and test the AWS services locally due to some of the companies doesn't have a testing/development environment in their cloud provider to play with.
I have explored and used one of the awesome tools and will give a brief introduction about it.
It's LocalStack. Localstack is one of the most popular AWS cloud stack open source for mocking/testing the cloud applications simply by running everything in your local system/environment. It accelerates the testing environment on your local system and provides the same functionality and API's as the real AWS cloud does. It helps by
For e.g. you can use Lamda functions, DynomoDB, SQS, SNS, API gateway and much more on your local machine without paying a single penny to AWS. Isn't it awsome!!!
Let's see what are the things which are required to set up the LoclStack. There are more than options available to setup the LocalStack but i think Docker-Compose is one of the best way to install and configure and for that you should have only 2 things i.e.
Installation
Few sample examples
Recommended by LinkedIn
awslocal sqs create-queue --queue-name my-first-sqs-queue.fifo --attributes FifoQueue=true --region us-east-1
If the above command is successful then the output will be similar to
{
"QueueUrl": "http://localhost:4566/000000000000/my-first-sqs-queue"
}
awslocal sqs list-queues
awslocal sqs get-queue-attributes --queue-url http://localhost:4566/000000000000/my-first-sqs-queue --attribute-names All
aws configure get region --endpoint-url=http://localhost:4566
You can see from the above example that I am able to run the AWS CLI command against the lcoalstack container.
Isn't it really fun and reduce the complexity and headache to develop and test the AWS services locally.