Creating function URLs for Lambda functions

Table of Content

Function URL

A function URL is a dedicated HTTP(S) endpoint for your Lambda function.

  • When you create a function URL, Lambda automatically generates a unique URL endpoint for you.

You can control access to your Lambda function URLs using the AuthType parameter:

  • When you configure your function URL, you must specify one of the following AuthType options:
    • AWS_IAM – Lambda uses AWS Identity and Access Management (IAM) to authenticate and authorize requests based on the IAM principal’s identity policy and the function’s resource-based policy. Choose this option if you want only authenticated users and roles to invoke your function via the function URL.
    • NONE – Lambda doesn’t perform any authentication before invoking your function. However, your function’s resource-based policy is always in effect and must grant public access before your function URL can receive requests. Choose this option to allow public, unauthenticated access to your function URL.

In this workshop, to simplify the learning we will create functions URL with AuthType of NONE without implementing any authentication mechanism in the Lambda function.

Except some rare case that you may want your function URL to be public as a web hook, don’t use AuthType of NONE for your function URL. And in these rare case, you still need to implement basic authentication mechanism in your Lambda function. See Tutorial: Creating a webhook endpoint using a Lambda function URL - AWS Lambda

Creating function URLs

In this step, you will create 5 function URLs, one for each Lambda function.

alt text

  1. To create the function URL for list-users Lambda function:

    • Open the Functions section of Lambda console

    • Click list-users function.

    • Open the Configuration tab

    • Open the Function URL section

    • Click Create function URL

      alt text

    • In the Configure Function URL page, choose Auth type of NONE.

    • Click Save

      alt text

    • After the function URL is created, you can see it in the Function overview section or in the Configuration / Function URL section.

      alt text

    • Copy the function URL, you will need it for the next step.

  2. Repeat this process to create the function URLs for other Lambda function: create-user, get-user, update-user, delete-user.