Skip to content
This repository has been archived by the owner on Feb 2, 2020. It is now read-only.

SAM Local and DynamoDB Local demo for Python Hot reloading

License

Notifications You must be signed in to change notification settings

heitorlessa/sam-local-python-hot-reloading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archived

Today, we have better solutions like AWS Toolkit extension that provides both debugging, build, and local invoke.

Requirements

Quick start

We need to bootstrap our environment quickly in order to have both SAM Local and DynamoDB Local to play together nicely:

  1. Create a docker network
docker network create sam-demo
  1. Run and Bootstrap DynamoDB Local

You need to install boto3 and faker library to bootstrap dynamo (pip install faker boto3), or simply use AWS CLI

docker run -d -v "$PWD":/dynamodb_local_db -p 8000:8000 --network sam-demo --name dynamodb cnadiminti/dynamodb-local
python bootstrap_dynamodb.py -t "users" --hash-key "id"
  1. Create local development environment and run
make build-dev SERVICE="users"
sam local start-api --docker-network sam-demo
  1. Test API locally
curl localhost:3000/getUsers

About

SAM Local and DynamoDB Local demo for Python Hot reloading

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published