0% found this document useful (0 votes)
3 views

Document for LocalStack SQS nd DynamoDB

LocalStack is a cloud service emulator that allows developers to test AWS applications locally, reducing costs and enabling rapid iteration without needing a live AWS environment. It supports various AWS services and facilitates debugging and testing of applications in an isolated environment. The document includes installation instructions, benefits of using LocalStack, and specific commands for working with AWS SQS (Simple Queue Service).
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Document for LocalStack SQS nd DynamoDB

LocalStack is a cloud service emulator that allows developers to test AWS applications locally, reducing costs and enabling rapid iteration without needing a live AWS environment. It supports various AWS services and facilitates debugging and testing of applications in an isolated environment. The document includes installation instructions, benefits of using LocalStack, and specific commands for working with AWS SQS (Simple Queue Service).
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Document for LocalStack

1.Install LocalStack
Official Document link
https://docs.localstack.cloud/getting-started/installation/

executable file will be downloaded


Take directory to location of executable file and
python3 -m pip install --upgrade localstack

with help of this command install Localstack

localstack –version

to confirmation that localstack in installed successfully

What is LocalStack?
2. LocalStack provides an easy-to-use test/mocking framework for

developing Cloud applications. This means you can test AWS

cloud resources locally on your machine.

3. LocalStack is a cloud service emulator that runs in a single

container on your laptop or in your CI environment. With

LocalStack, you can run your AWS applications or Lambdas

entirely on your local machine without connecting to a

remote cloud provider!


4. Note: LocalStack supporting only AWS cloud stack.

5. Benefits of Using LocalStack

 Reduce Cost

 Test AWS Cloud Resource Locally

 Learn AWS Cloud Resource Locally


 Debug Locally

Why LocalStack ?¶

 Local stack allows developers to test their applications


in their local environment
 No need to deploy the application to the AWS services
 It will save development cost of the application
 Easy to debug the applications which depends on the
various AWS resources.

why developers find LocalStack useful:

Cost Reduction: LocalStack allows developers to simulate


various AWS services locally without incurring actual costs
associated with using the live AWS environment. This is
particularly beneficial during the development and testing
phases, where cost control is essential.

Rapid Iteration: With LocalStack, developers can work offline


and iterate quickly on their applications without relying on a
stable internet connection or waiting for deployments and
updates on the live AWS platform. This saves time and
increases productivity.

Isolated Development Environment: LocalStack creates an


isolated environment that closely mimics the behavior of AWS
services such as S3, DynamoDB, SQS, SNS, and more.
Developers can perform integration testing and debug their
code against these simulated services locally, ensuring their
application functions correctly before deploying it to the
production environment.
Reduced Dependencies: By using LocalStack, developers can
minimize external dependencies on the live AWS environment
during local development. They can work independently without
worrying about shared resources and potential conflicts that
might arise when multiple developers are using the same AWS
account.

Testing Edge Cases: LocalStack enables developers to test


edge cases, error scenarios, and failure conditions by
simulating specific AWS service behaviors. This helps uncover
potential issues and vulnerabilities early in the development
process, leading to better overall code quality.

Continuous Integration/Continuous Deployment (CI/CD):


LocalStack integrates well with CI/CD pipelines, allowing
developers to incorporate automated tests and evaluations
against the simulated AWS services. This ensures that changes
made to the codebase do not introduce regressions or
unexpected issues.

Overall, LocalStack enhances developer productivity by


providing a local replica of the AWS cloud stack, reducing
costs, enabling offline development, facilitating rapid
iteration, and supporting comprehensive testing. It is a
valuable tool for developers aiming to build robust and
scalable cloud applications using AWS services.

SQS(Simple Queue Service)

What is SQS?

o SQS stands for Simple Queue Service.


o SQS was the first service available in AWS.
o With the help of SQS, you can send, store and receive
messages between software components at any volume
without losing messages.

o Amazon SQS is a web service that gives you access to a


message queue that can be used to store messages while
waiting for a computer to process them.

Refer this doc to more info


https://onexlab-io.medium.com/localstack-sqs-a0c36fd13108

 Create one docker-compose.yaml

version: '3.0'

services:

localstack:
image: localstack/localstack:latest
environment:
- AWS_DEFAULT_REGION=ap-southeast-1
- EDGE_PORT=4566
- SERVICES=sqs
ports:
- '4566:4566'
volumes:
- "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"

 Podman-compose up -d
 Container is up check using podman ps

 And needs to install AWSCLI


Use the following command on cmd to install AWS
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
 Needs to configure aws credentials

 To create a queue use the following command


aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name
WorldwideMoney
http://localhost:4566/000000000000/WorldwideMoney

 Command to list Queues


aws --endpoint-url=http://localhost:4566 sqs list-queues
 Command to add data in Queue
aws --endpoint-url=http://localhost:4566 sqs send-message --queue-url
http://localhost:4566/000000000000/WorldwideMoney --message-body
"Welcome to SQS queue by Sudarshan"

 Command to read data from Queue


aws --endpoint-url=http://localhost:4566 sqs receive-message --queue-
url http://localhost:4566/000000000000/WorldwideMoney

 To Delete Queue
aws --endpoint-url=http://localhost:4566 sqs delete-queue --queue-url
http://localhost:4566/000000000000/ WorldwideMoney

You might also like