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 

  • Saving the cost for development teams
  • No cloud infrastructure needed
  • Reduce the development and testing time cycle

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. 

  • Docker
  • Docker Compose

Installation

Few sample examples

  • How to create a FIFO Queue - what we have to do just use the AWS CLI against the Locastack container

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"
}        

  • To check list of available queue

awslocal sqs list-queues        

  • To check the queue attributes

awslocal sqs get-queue-attributes --queue-url http://localhost:4566/000000000000/my-first-sqs-queue --attribute-names All        

  • To get the region details

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.

To view or add a comment, sign in

More articles by Rohit Roy

Others also viewed

Explore content categories