AWS Lambda Naming Conventions and Examples
Lambda-specific rules: the 64-character limit, allowed characters, how names flow into log groups and IAM, and the patterns teams use in real estates.
The hard rules
AWS Lambda enforces its function-name rules at creation time, so there is no negotiating with them:
- Maximum 64 characters. Long service-action-object chains can hit this faster than expected — count before you commit.
- Allowed characters: letters (
a-z,A-Z), digits (0-9), hyphens (-), and underscores (_). No spaces, no dots, no slashes. - Uniqueness is per region per account. The same name can exist in two regions, which is exactly why environment tags matter.
Generate candidates with the cloud function name generator — it caps every name at 64 characters and sticks to the allowed character set.
Where the name shows up
The function name is load-bearing in AWS. It becomes part of the function's ARN (arn:aws:lambda:region:account:function:billing-prod-process-payment), determines the default CloudWatch Logs group (/aws/lambda/<FunctionName>), and appears in IAM policies, event source mappings, and X-Ray traces. Renaming a function is therefore not cosmetic — it is effectively a redeploy with new ARNs, so choose names you can live with.
Recommended Lambda patterns
| Pattern | Example | Best for |
|---|---|---|
service-env-action-object | billing-prod-process-payment | Most teams; console grouping by service |
env-service-action-object | prod-billing-process-payment | Incident response; blast-radius grouping |
service-action-object | billing-process-payment | Single-environment accounts or when env lives in the account/region instead |
trigger-action-object | cron-nightly-reconcile | Scheduled and event-source functions |
Environment tags in practice
Use short, fixed abbreviations: dev, staging, prod, test. Put the tag in the same position in every name — middle placement (billing-prod-process-payment) is the most common because it keeps the service prefix (the sort key) first. Avoid encoding the region in the name; the region is already in the ARN and the console.
Versioning and aliases
Lambda has built-in versioning and aliases — prefer those over version suffixes in names for routine deploys. A suffix like -v2 is still useful during migrations when two implementations must coexist (for example, search-prod-index-products-v2 running beside v1), but treat it as temporary and remove the old function rather than accumulating versions forever.
Names vs. tags
Names identify; tags describe. Put the stable identity (service, environment, purpose) in the name, and the changeable metadata (owner team, cost center, data classification, repository URL) in tags. Parsing a name with a script to recover the cost center is a sign that information belongs in a tag instead.
IaC-friendly naming
If you deploy with the Serverless Framework, SAM, CDK, or Terraform, derive the function name from variables (service, stage) rather than hardcoding it — that way the convention is enforced by the template, not by memory. A generated shortlist from the free cloud function name generator makes a good starting point for the default values in those templates. See also the use cases page for how platform teams roll a convention out across hundreds of functions.