AWS Lambda For The Impatient Part 2
Written by Nikos Vaggalis   
Monday, 23 January 2017
Article Index
AWS Lambda For The Impatient Part 2
Attaching policies to the Role
Calling with AWS CLI and HTTP requests
Using Postman

 

Step 5 - Calling through the API Gateway with Postman

It's Postman time again. We use the same settings as we did in the first part of the tutorial but slightly changed to incorporate the following:

  1. The new HTTP endpoint
  2. Authorization should now be AWS Signature
  3. User Access Key
  4. User Secret Key
  5. AWS Region
  6. Service name of 'execute-api'

Leaving the body/payload of the call as it is:



Postman generates special headers that include an AWS Signature calculated by the combination of the user's Access and Secret Keys.


 
Submitting the payload {"key1:"value1"} results in the by now familiar {"received":"value1"} response:


A quick look at the log entry of our API-Gateway-Execution point confirms that everything runs just fine:





This takes us to the end of Part 2.


Recap

So what have achieved in this part? 

  • Created a new Lambda function, HTTP endpoint and Trigger

  • Created a Role and a User

  • Bound the Role to the User and vice versa and granted  permissions on both the Lambda function and API Gateway

  • Installed and configured the AWS CLI

  • Assumed the role and called the function through the CLI with the 'aws lambda invoke' command

  • Called the function through the HTTP endpoint by using Postman, passing the user's Access and Secret key in to create a unique signature for authenticating

In the next and final part we're going to call our lambda programmatically through the help of Perl and its awesome Paws module.



 

Related Articles

AWS Lambda For The Impatient Part 1

AWS Lambda For The Impatient Part 3 

 

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.

 

Banner


GitPod Adds Native GitLab Integration
15/10/2020

Users of GitLab can now make use of the Gitpod UI. GitLab is a popular DevOps tool that is used by more than 100,000 organizations. A partnership between GitLab and Gitpod means developers can make us [ ... ]



JetBrains Kotlin 1.4 Online Starts Today
12/10/2020

Kotlin 1.4 Online, a 4-day event organized by JetBrains, the creators of Kotlin, starts today, October 12th and continues until Thursday. Each day's program includes four 30-40 minute talks and is rou [ ... ]


More News

 

square

 



 

Comments




or email your comment to: comments@i-programmer.info

 



Last Updated ( Sunday, 19 February 2017 )