Skip to content
Clean Lambda Function
Lean Mean Clean Apps

Five templates, one search box. Everything in the docs is in here, including the bits we hoped you'd skim.

Try one of these

Results say which template they came from, so you won't end up reading about Lambda when you wanted GraphQL. Again.

Deploy to AWS

The function deploys as a container image. The Amazon.Lambda.Tools CLI builds the image, pushes it to Amazon ECR and creates or updates the function in one go.

  1. Install the CLI.

    Terminal window
    dotnet tool install -g Amazon.Lambda.Tools
  2. Fill in src/Presentation/aws-lambda-tools-defaults.json. The template leaves profile and region empty on purpose. We don’t know where you live.

    {
    "profile": "default",
    "region": "ap-southeast-2",
    "configuration": "Release",
    "package-type": "image",
    "function-memory-size": 256,
    "function-timeout": 30,
    "image-command": "Presentation::Acme.Reviews.Presentation.LambdaFunction.Handler::GetMovies"
    }
  3. Deploy.

    Terminal window
    dotnet lambda deploy-function --project-location ./src/Presentation

    The CLI asks for a function name and an IAM role the first time.

  4. Invoke it for real.

    Terminal window
    aws lambda invoke --function-name acme-reviews-get-movies \
    --cli-binary-format raw-in-base64-out --payload '{"limit":5}' response.json

Each Lambda function runs one handler method. To deploy GetAuthors and GetReviews as well, deploy the same image again with a different image-command and function name. They share the code but scale and bill separately.

Setting Template default Why you might change it
function-memory-size 256 MB Lambda gives you CPU in proportion to memory, so more memory often means a faster cold start
function-timeout 30 seconds The handler stops its work when the invocation is about to run out of time, so set this to what your callers will wait for