Example project for showing how to use AWS SAM local, Localstack, and DynamoDB Local with VS Code development containers.
- Open the project with VS Code and open the development container
- Docker compose is used to spin up the development container, the Localstack container, and the DynamoDB local container
- All the containers will be spun up on the same custom docker network
- Set the
CodeUri
intemplate.yml
to the absolute path to your project (outside of docker) - Run SAM Local using
sam local start-api --container-host 'host.docker.internal'
- Use
curl
or something else to make the API call to the service. excurl http://127.0.0.1:3000/
Note The same options are likely needed when running other variants of the sam local
commands