Skip to content
Clean Lambda Function
Lean Mean Clean Apps

Five templates, one brand, 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.

Secure the function

Invoked directly, the function has no bearer token to check, so AWS IAM decides who can call it. Its HTTP routes are open until you add an authorizer. Think of IAM as the bouncer and your function as the band. The band doesn’t check tickets.

Only principals allowed lambda:InvokeFunction on the function can invoke it. Grant that through an IAM policy on the caller, or through the function’s resource-based policy for services like EventBridge, SQS or S3. Keep it to the callers that need it. “Everyone in the account” is not a security model.

The Http* functions already sit behind an API Gateway HTTP API. Add a JWT authorizer to it in serverless.template and API Gateway validates the token before the function runs, so bad requests never cost you an invocation, and the function itself stays the same. The sample routes only read, but a list of everyone’s reviews is still worth a lock if it isn’t meant to be public.

The sibling templates for HTTP, Clean Minimal API and Clean Web API, have optional bearer token checking built in if you’d rather run a web API than a function.