AWS Lambda For The Impatient Part 1
Written by Nikos Vaggalis   
Monday, 02 January 2017
Article Index
AWS Lambda For The Impatient Part 1
The API Gateway
Actions and Testing
CloudWatch log files

Step 5 - CloudWatch log files

Everything went as planned, but what happens when it does not? Every call to our https://bwxuad56tl endpoint is recorded in a CloudWatch log. In order to check it we have to pick the CloudWatch service->Logs,
and the relevant API-Gateway-Execution-Logs, in this case API-Gateway-Execution-Logs_bwxuad56tl/prod

click on the latest log stream:

and be unfortunately confronted with a No events found message and with not sign of our call's recording.

What could be the matter?

The matter is that we must also activate our CloudWatch log monitoring, so back to the API Gateway dashboard in order to change the production stage of our API, 'Stage->prod', from:


If while on it you get a CloudWatch Logs role ARN must be set in account settings to enable logging

then in the Setting tab of our API Gateway dashboard, enter a role ARN (ARN is just a unique 'serial' number that is assigned to each individual resource) that has permissions to write to the logs. Well we've already have done that, it's the 'lambda_basic_execution_helloWorldNodeJs' role we had created in the very beginning of our tutorial.

In order to get it's ARN you have to navigate to the AWS Security, Identity & Compliance->IAM service dashboard, pick the role from the list and copy its ARN.Then back to the API Gateway dashboard to paste it into the CloudWatch log role ARN input box

Back to Postman for one final test. Fire the same request again and navigate to the CloudWatch Logs once more.We instantly know that something went right since we observe that the Last Event Time entry has been filled with a time-stamp.

Picking the stream reveals the fruits of our effort in a detailed backlog recording of our call.

Thus, we set up, called, received, recorded, therefore at this point we conclude the first part of our 'AWS for the Impatient' tutorial series, which took us through the process of creating our very first function and calling it through an open, public, unrestricted and unauthenticated endpoint.The next part will be more involved as, despite it talking about the very same Lambda function, it now calls it through authenticated calls tied to an IAM profile.




More Information

What Is AWS Lambda?

AWS Security Best Practices

Creating an AWS Lambda Function for a Custom Skill

AWS Lambda pricing

Related Articles

Health Level 7 (HL7) with Perl 


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.



Vint Cerf Awarded IEEE Medal of Honor

Considered the highest honor in the field of Electrical Engineering, the IEEE Medal of Honor was inaugurated in 1917 and is awarded annually to a single recipient for exceptional contributions or [ ... ]

Learn To Build A Full Stack Application with Azure SQL And Prisma

A self paced course by Microsoft Learn based on a real case study on how to apply Azure SQL with Prisma and Vue.

More News





or email your comment to:

Last Updated ( Tuesday, 03 January 2017 )