OpsCanary
awslambdaPractitioner

Mastering Lambda Function URLs: A Guide for Production

5 min read AWS DocsOct 18, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

Lambda Function URLs exist to streamline the way you invoke your Lambda functions over HTTP(S). They solve the problem of needing a straightforward, dedicated endpoint for your functions, allowing you to call them directly from web browsers, curl, Postman, or any HTTP client without additional setup.

When you create a function URL, AWS generates a unique URL endpoint in the format https://<url-id>.lambda-url.<region>.on.aws. This endpoint is dual stack-enabled, meaning it supports both IPv4 and IPv6. You can configure various parameters, including the authentication type, which can be set to either AWS_IAM or NONE, with the default being NONE. CORS settings are crucial for web applications, and while the documentation suggests configuring them directly on the function URL, you can also set them up in your function response, although that’s not recommended.

In production, remember that function URLs are not available in all AWS regions, so check their availability before planning your deployment. Also, ensure that the function you want to expose via a URL already exists when using the AWS CLI to create the URL. Misconfiguring CORS can lead to frustrating issues with cross-origin requests, so take the time to set it up correctly from the start.

Key takeaways

  • →Create function URLs using the AWS CLI with the command `aws lambda create-function-url-config`.
  • →Configure CORS settings directly on the function URL to avoid manual header management.
  • →Use resource-based policies for security and access control on your Lambda function URLs.
  • →Remember that function URLs support both IPv4 and IPv6, enhancing accessibility.
  • →Check AWS Regional Services for function URL availability in your desired region.

Why it matters

In production, Lambda Function URLs can drastically reduce the complexity of invoking functions, leading to faster development cycles and more responsive applications. Properly configured, they enhance security and performance for your serverless architecture.

Code examples

AWS CLI
aws lambda create-function-url-config \
    --function-name my-function \
    --qualifier prod \ // optional
    --auth-type AWS_IAM --cors-config {AllowOrigins="https://example.com"} // optional
JSON
{"Type" : "AWS::Lambda::Url",
  "Properties" :{"AuthType" : String,
      "Cors" : Cors,
      "Qualifier" : String,
      "TargetFunctionArn" : String
YAML
1Type: AWS::Lambda::Url
2Properties: 
3  AuthType: String
4  Cors: 
5    Cors
6  Qualifier: String
7  TargetFunctionArn: String

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOceanSponsor

Simple, affordable cloud — VMs, Kubernetes, and managed databases in minutes. Trusted by 600,000+ developers. Spin up a Droplet in 60 seconds.

Try DigitalOcean →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.