TL;DR
Briefly tested Lambda Function URLs that AWS announced yesterday.
Introduction
Hi everyone! I am Kosuke who is working as a Product Owner based in Japan and one of the members of AWS Community Builders for Serverless.
My SNS are;
- Twitter -> @coosuke
- LinkedIn -> Kosuke Enomoto
- Blog(Japanese) -> note
What is "Lambda Function URLs" ?
On Apr/06/2022 AWS announced a new feature that makes it easier to invoke functions through an HTTPS endpoint as a built-in capability of the AWS Lambda service. You can see details at AWS blog.
Announcing AWS Lambda Function URLs: Built-in HTTPS Endpoints for Single-Function Microservices
Let's say hello with Lambda Function URLs!!
I briefly tested that new feature within a half hours.
Here are the procedures.
- Log on to AWS Console and go on to AWS Lambda > Functions.
- Click "create function" on the upper right.
- Choose "Author from scratch"
- name the Function name(helloWorldUrlTest), choose Runtime(Node.js 14.x) and Architecture(x86_64). Permission can stay as default(as chosen Create a new role with basic Lambda permissions).
- Open Advanced settings, check Enable function URL and you will see some more settings, Auth type to NONE and check Configure cross-origin resource sharing(CORS).
- Click Create function button on the bottom.
- Here you created the function!
- You can see the function URL. Click it and you will see "Hello from Lambda!" That's it!
Closing remarks
It took only just a few minutes to see "Hello world" in the browser.
The codes just returns simple JSON including HTTP status code 200 and body "Hello from Lambda!".
{
"statusCode": 200,
"body": "\"Hello from Lambda!\""
}
The AWS blog offers sample codes to deep dive into the function URLs feature, so you just build and test it!
Thank you very much for reading! See you next time!!
Top comments (0)