OpsCanary
Back to daily brief
awslambdaPractitioner

Mastering Lambda Function URLs: The Key to Simplified HTTP Access

5 min read AWS DocsApr 22, 2026
PractitionerHands-on experience recommended

Lambda function URLs exist to simplify the way you invoke your Lambda functions over HTTP(S). Instead of dealing with complex API Gateway setups, you can create a dedicated endpoint that allows direct access to your function. This is particularly useful for microservices or serverless architectures where quick, straightforward access is essential.

When you create a function URL, Lambda generates a unique URL endpoint in the format https://<url-id>.lambda-url.<region>.on.aws. This endpoint supports both IPv4 and IPv6, ensuring broad compatibility. You can configure parameters like authentication type, which can be set to either AWS_IAM or NONE, allowing you to control access. CORS settings can also be configured, enabling seamless integration with web applications. If you're using the AWS CLI, remember that the function must already exist before you can create a function URL. CORS headers are automatically added to all responses when configured, which saves you from manual handling.

In production, be aware of the regions where function URLs are not supported, including several in Asia and Europe. This limitation can affect deployment strategies if you're operating in those areas. Additionally, while creating function URLs is straightforward, ensure you understand the implications of your authentication settings and CORS configurations to avoid security pitfalls. The automatic handling of CORS headers is a boon, but it requires careful setup to align with your application's needs.

Key takeaways

  • Create a function URL using the AWS CLI with the command: `aws lambda create-function-url-config`.
  • Set the authentication type to AWS_IAM or NONE based on your security requirements.
  • Configure CORS settings to automatically add headers to responses, facilitating cross-origin requests.
  • Remember that function URLs are not supported in specific AWS regions, impacting your deployment options.
  • Ensure the Lambda function exists before creating a function URL to avoid errors.

Why it matters

In production, Lambda function URLs drastically reduce the complexity of invoking serverless functions, enabling faster development cycles and simpler architectures. This can lead to improved performance and reduced operational overhead.

Code examples

AWS CLI
aws lambda create-function-url-config \
    --function-namemy-function\
    --qualifierprod\ // optional
    --auth-typeAWS_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 →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.