Skip to content

nirradi/localstack-python-lambda-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Start for Python Lambda with localstack

Prerequisites

  • docker
  • docker-compose

Deploy the lambda to localstack

bring up localstack (wait for Ready to continue):

docker-compose up localstack

bash into the cdk image

docker-compose run cdk bash

execute these commands in the cdk container

cdklocal bootstrap
cdklocal deploy

note the rest api id (hashy string in the beginning of the url that was created) https://{restApiId}.execute-api.us-east-1.localhost/prod/

  1. See that it works
curl http://localstack:4566/restapis/{restApiId}/prod/_user_request_/

(notice that the url is localstack, replace with localhost if running from host and not container)

Start the SAM local development server

note: this doesn't work properly because of an issue with aws-sam-cli=1.22

ROOT=$(pwd) docker-compose up sam-ap

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published