Create a Lambda Function
Understand how to create an AWS Lambda function from scratch, configure runtime and permissions, modify function code, and test it within the AWS console. This lesson guides you through managing Lambda handlers, execution roles, and securing function access for automation tasks.
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.
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.
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.
Execution role: Under “Permissions,” select “Create a new role with basic Lambda permissions.” AWS will automatically create an ...