MJ Berends talk - Women & Non-Binary Focused Intro to AWS
Local AWS Development
with LocalStack and Moto
• Engineering Team Lead at
• Still overwhelmed by AWS
• Talks people through big life
• Lets me learn lots about AWS
So, you want to run your code.
(And also share it with others. Maybe in a web page?)
A couple options:
• A machine you own
• Total Control
• The way you like it
• Limited resources
• Inaccessible to others
• Hard to replicate
• Run code in the cloud
• Scale out
• Delegate server maintenance
• Proprietary services
• Unfamiliar environments
• Managing security
Interlude: Alphabet soup !
Service Quick Blurb
S3 (Simple Storage Service) Cheap object-based storage
NoSQL database with fast and scalable single-
SNS (Simple Notification Service) Pushes messages to multiple destinations
SQS (Simple Queue Service)
Buffers messages until there’s processing
EC2 (Elastic Compute Cloud)
General-purpose machine that will run any
program you want it to
Example: Let’s make a Dropbox!
Local System AWS
Ack! So Different!
AWS Open Source
Compute • EC2 • A CPU +
Storage • DynamoDB
Transport • SNS
Presentation • S3 webpage • Nginx + Nodejs
Nevertheless, AWS is...
...and their services play nicely
with each other!
Let’s recap: Different approaches
Local development cycle
Use any tool you want, as long as
it runs on your OS
AWS development cycle
Use a combination of proprietary,
open-source, and AWS-specific
• What are ways of resolving this tension?
1. Don’t use any AWS-specific services
Use your own services in both your local environment and on your
(Deploy this code to EC2 instances in AWS, which you have complete
2. Split codebase
• Maintain AWS-specific and local development versions
• Find alternatives to AWS-specific services for local dev
• Let ops maintain anything AWS-specific
• Develop against an AWS sandbox in limited cases
3. Use AWS everywhere you can
• Use AWS services in all environments, both cloud and local
• Find local versions of AWS code. Use them.
• And also use real AWS services in the cloud
Nothing by AWS, thank you Same code runs everywhere Need to manage everything
Keep my codebases separate,
N/A Different code in different places
AWS everywhere! Same code runs everywhere Does this really work? Won’t there
be subtle differences? I can’t have
everything the same, can I?
Local Dev Tools
A fully functional local AWS cloud
stack. Develop and test your cloud
apps offline! (Backed by Atlassian)
Moto is a library that allows your
python tests to easily mock out
the boto library
Easy to install Clear docs Coverage Robustness Attention
Localstack ✅ ⚠ 15+ ⚠
Moto ✅ ✅ 30+ ✅
What’s in a Localstack?
Local DynamoDB Elasticsearch
LocalStack is based on Moto!
What can you do?
• Run many common AWS
services locally, including S3,
DynamoDB, SNS, and SQS.
• Develop application logic that
utilizes those AWS services
• Simulate failure scenarios, such
as services outages or capacity
What can’t you do?
• Run other services outside the
set already implemented
• Test networking features, like
VPCs or CORS
• Test access controls, roles, or
Interlude: How do you access AWS?
• Online GUI
• Detailed tutorials
• Text interface
• Use in the shell
• Integrates with code
• Many languages
• CLI or SDK actions
(Or, run in Docker)
CLI Example: Create an SQS Queue
Just set the
to the Localstack url for the
So magic ✨
• Design Applica-on logic
• Familiarize yourself with services
• Build applica-on prototype using services
• Test Services in AWS
Design application logic
• Identify candidates for AWS services
Familiarize yourself with services
• Explore AWS CLI tutorials
• Run Localstack and point AWS CLI toward instance, and try things out!
Build application prototype
Prototype the interaction of
application logic with AWS
Test in AWS
Explore permissions, networking,
and application load
Test Services in AWS sandbox
• Replace localstack endpoint with Sandbox endpoint
• Add ”real” configurations
• Access controls
• Disaster recovery
• Multiregion support
Use Localstack for exploring
services and doing initial
Don’t be afraid of AWS services!
You can keep dev versions closely
coupled with applicaAon
• Thanks to AWS Chicago for hosting! And also...
• AWS for SO MANY neato products
• Localstack (https://github.com/localstack/localstack)
• Moto (https://github.com/spulec/moto)
• Open-source contributors everywhere
And, of course, everyone here!