This is a simple AWS SAM project containing a single Lambda function called HelloWorldFunction
.
- AWS CLI
- AWS SAM CLI
- Docker (if you want to test the Lambda function locally)
- Clone the repository or download the ZIP file.
- Navigate to the project directory:
cd aws-lambda-local
- Install the dependencies:
sam build
- Start the Lambda function locally:
sam local invoke HelloWorldFunction
- Start the API Gateway locally:
sam local start-api -t template.yaml --debug
- Package the application:
sam package --output-template-file packaged.yaml --s3-bucket YOUR_S3_BUCKET_NAME
- Deploy the application:
sam deploy --template-file packaged.yaml --stack-name YOUR_STACK_NAME --capabilities CAPABILITY_IAM
You can get your lambda code and replace this in the hello_world function.