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

Latest commit

 

History

History
43 lines (29 loc) · 1.14 KB

README.MD

File metadata and controls

43 lines (29 loc) · 1.14 KB

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