Skip to content

Running AWS Lambda functions

Create Project

Todo

traefik config tab

compose.yml

services:
  function:
    image: public.ecr.aws/lambda/python:3.8
    command: app.lambda_handler
    ports:
      - 9999:8080
    volumes:
     - ./app.py:/var/task/app.py

Lambda function

Todo

Python/Node code tabs

Python app.py

import boto3
import botocore

def lambda_handler(event, context):
   print(f'boto3 version: {boto3.__version__}')
   print(f'botocore version: {botocore.__version__}')

Deploy and Test

ccd project my-function deploycurl -XPOST "http://localhost:9999/2015-03-31/functions/function/invocations" -d '{}'..
ccd project my-function logs

Todo

Was this page helpful?