Posts

Handle errors in Amazon API Gateway from integrated Lambda functions

Image
In this blog, I am going to show how your API Gateway REST API behaves whenever a Lambda function which is integrated to it, returns an error. You will also learn how to handle those errors by mapping them to a corresponding HTTP status code as per your business requirement and use case. Types of Lambda Integration Before going ahead with the demo or setup, I would like to tell you about the two types of Lambda integration supported in API Gateway. Proxy integration  - The client sends a request to the API Gateway which acts as a proxy server, sends the entire request to its backend Lambda function. The integration method should be set as HTTP POST with the ARN of your Lambda function. Also, note that API Gateway should be granted with sufficient  permission to invoke the function. Non-proxy/Custom integration  - Here the request received and response send by the API Gateway can be customized as per the requirement of the use case using Mapping templates and Models. Handling of Lambda

Kubernetes: A Synopsis and Introduction

Image
  Kubernetes , also known as K8s , is an open-source system for automating deployment, scaling, and management of containerized applications. It was developed by Google later the project was open-sourced. Before getting into the details of K8S, a concept of Containerization and Docker is essential, go through my blog on once. K8s features - Service discovery and load balancing Storage orchestration Automated rollouts and rollbacks Automatic bin packing Self-healing Secret and configuration management Kubernetes Components A Kubernetes cluster comprises of —  Control Planes and Worker Nodes . Our application runs in its containerized form inside a pod, which is deployed in a node. Each of those nodes, also called Worker Node, is managed by a Control Plane or Master Node which as a whole constitutes a Cluster. The components of a Master Node / Control Plane - The components of a Worker Node - kubelet  — agent that runs on each node in the cluster. It makes sure that containers are runni

Access Control to AWS resources using Lambda Authorizer Function

Image
  Hello there! In my previous blog I have discussed how to create a REST API endpoints for CRUD functionalities using Amazon API Gateway, AWS Lambda and Amazon DynamoDB, refer this page . Lambda Authorizer You may create REST API services for end customers but depending upon the use case you need to decide if those services will be available for public or only the authenticated and authorized customers can access them using special token or passphrase. You can have these services processed API Gateway has a special feature that uses a Lambda function to control access to your API. This is known as Lambda authorizer. When a request is made to one of the API’s methods, API Gateway makes a call to the Lambda authorizer that token or parameters sent by the client as input and then returns an IAM policy as output that allows the user to access the API or block the access in case the authorization fails. There are two types of Lambda authorizers:- Token based and Request Parameter based . S

CRUD REST API implementation using Amazon API Gateway, AWS Lambda and Amazon DynamoDB

Image
  In case you are thinking how to create a serverless CRUD application and expose the same to your external world, then follow the below steps, you will find a detailed understanding of it I believe. Serverless CRUD REST API Implementation First and the foremost thing is that you need to have an AWS account. In case you are new, you can create a free account  https://aws.amazon.com/free  where you will receive a lot of free tier resources to play around and have the feeling of cloud. For the past few years, Serverless Computing is a hot topic. But what is it? It is basically a cloud computing execution model in which the cloud provider is in charge of creating machine resources on demand and taking care of the servers on behalf of their customers. The customers responsibility is to provide the code. AWS Lambda service provides this feature of serverless computing. Here, we are going to use these services — Amazon API Gateway, AWS Lambda and Amazon DynamoDB. I have considered a Data Mod