...

/

Create a Lambda Function

Create a Lambda Function

Learn to create our first Lambda function.

Navigate to AWS console.

We log in as a root user, and fill in our credentials. After a successful login, we will see the main AWS console dashboard.

AWS dashboard
AWS dashboard

Type “Lambda” into the search engine, and after a while, “Lambda” will be displayed, along with an orange logo. Click on this service.

We will see a list of all the Lambda functions we have in our region. If you've never created a Lambda function, do not worry; that list will be empty.

Lambda service page
Lambda service page
  • Click on the “Create function” button. We are presented with three options “Author from scratch,” “Use a blueprint,” and “Browse serverless app repository.” Choose “Author from scratch.”

Let's configure the function next.

  • Function name: Enter a name for our Lambda function (e.g., “MyNodeJsFunction”).

  • Runtime: Choose “Node.js 18.x” (or the latest Node.js version available) from the “Runtime” dropdown menu.

  • Architecture: Choose “x86_64” for the function code.

Lambda creation process
Lambda creation process
  • Execution role: Under “Permissions,” select “Create a new role with basic Lambda permissions.” AWS will automatically create an ...