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

PatternExampleBest for
service-env-action-objectbilling-prod-process-paymentMost teams; console grouping by service
env-service-action-objectprod-billing-process-paymentIncident response; blast-radius grouping
service-action-objectbilling-process-paymentSingle-environment accounts or when env lives in the account/region instead
trigger-action-objectcron-nightly-reconcileScheduled 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.

Rule of thumb: if a new team member can guess what a function does and where it runs from the name alone, the name is good enough. Everything else is polish.