API Gateway, Cognito and Node.js Lambdas
5/5
()
About this ebook
AWS is one of the most popular cloud platforms available today, with services offering high performance and scale across the globe. However, integrating the various services with one another is not quite as easy as the brochure would have you believe.
This book steps you through the process of configuring a Lambda instance running a Node.js application, calling it from the web via an API Gateway instance, and securing the stack with Cognito user authentication.
Related to API Gateway, Cognito and Node.js Lambdas
Related ebooks
Kafka Up and Running for Network DevOps: Set Your Network Data in Motion Rating: 0 out of 5 stars0 ratingsAmazon Web Services in Action Rating: 0 out of 5 stars0 ratingsServerless Architectures on AWS, Second Edition Rating: 5 out of 5 stars5/5AWS Lambda in Action: Event-driven serverless applications Rating: 0 out of 5 stars0 ratingsStep by Step: Fault-tolerant, Scalable, Secure AWS Web Stack Rating: 0 out of 5 stars0 ratingsAmazon Web Services (AWS) Interview Questions and Answers Rating: 5 out of 5 stars5/5Hybrid Cloud Management with Red Hat CloudForms Rating: 0 out of 5 stars0 ratingsWeb Application Development with MEAN Rating: 0 out of 5 stars0 ratingsSpring Boot Intermediate Microservices: Resilient Microservices with Spring Boot 2 and Spring Cloud Rating: 0 out of 5 stars0 ratingsDevOps. How To Build Pipelines With Bitbucket Pipelines + Docker Container + AWS ECS + JDK 11 + Maven 3? Rating: 0 out of 5 stars0 ratingsDeploy Containers on AWS: With EC2, ECS, and EKS Rating: 0 out of 5 stars0 ratingsAngular Interview Questions and Answers: Including Angular 6,5,4 and 2 Rating: 0 out of 5 stars0 ratingsLearning Continuous Integration with Jenkins Rating: 0 out of 5 stars0 ratingsGroovy in Action Rating: 0 out of 5 stars0 ratingsSpring Security 3.x Cookbook Rating: 0 out of 5 stars0 ratingsQuick Start Kubernetes Rating: 0 out of 5 stars0 ratingsWebRTC Integrator's Guide Rating: 5 out of 5 stars5/5Kubernetes A Complete Guide Rating: 0 out of 5 stars0 ratingsHands-On Microservices with Kubernetes: Build, deploy, and manage scalable microservices on Kubernetes Rating: 5 out of 5 stars5/5Docker: Up and Running: Build and deploy containerized web apps with Docker and Kubernetes (English Edition) Rating: 0 out of 5 stars0 ratingsIrresistible APIs: Designing web APIs that developers will love Rating: 0 out of 5 stars0 ratingsDynamoDB Cookbook Rating: 0 out of 5 stars0 ratingsKubernetes: Preparing for the CKA and CKAD Certifications Rating: 0 out of 5 stars0 ratings
Programming For You
Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Web Designer's Idea Book, Volume 4: Inspiration from the Best Web Design Trends, Themes and Styles Rating: 4 out of 5 stars4/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsRaspberry Pi Cookbook for Python Programmers Rating: 0 out of 5 stars0 ratingsPython QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsPython: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Python Data Structures and Algorithms Rating: 5 out of 5 stars5/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5Poirot's Early Cases Rating: 5 out of 5 stars5/5The Little SAS Book: A Primer, Sixth Edition Rating: 5 out of 5 stars5/5Learn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5
Reviews for API Gateway, Cognito and Node.js Lambdas
1 rating0 reviews
Book preview
API Gateway, Cognito and Node.js Lambdas - Matthew Casperson
Matthew Casperosn © 2020
Table of contents
Welcome
The sample Node.js application
The Lambda instance
The Cognito user pool
The API Gateway instance
The sample web application
Hosting web apps in S3
Verifying the stack
Welcome
Technologies like microservices and serverless platforms have become popular as applications become more complex, with more developers contributing to codebases that are deployed with increasing frequency. By breaking down the functionality of a complex system into discreet applications and utilizing cloud services to host and scale those applications without having to provision the underlying hardware, developers can maintain a high velocity without sacrificing quality.
Limiting the functionality of any given microservice is key to maintaining this velocity, as it limits the scope of any changes and makes deployments or rollbacks more manageable. This also implies that cross-cutting functionality like network routing and security is best left to dedicated infrastructure rather than reimplemented with each microservice.
In AWS, Lambda, Cognito, and API Gateway services provide this cross-cutting functionality.
Hosting code in an AWS Lambda allows microservice applications to be deployed, executed and scaled without ever having to worry about the underlying hardware or operating system.
AWS Cognito then provides a service for securely managing and authenticating users, removing the need to reimplement user management systems.
Finally, API Gateway takes care of exposing your code via the web, tying together the security layer provided by Cognito, and passing traffic to and from Lambdas.
This guide describes the process of creating a Cognito user pool to manage our users, deploying a simple Node.js application to Lambda, integrating all these systems with API Gateway, and consuming the resulting endpoint from a simple JavaScript web application.
The sample Node.js application
The base layer of our infrastructure stack is the Lambda. Lambdas are typically small applications that execute relatively quickly in a disposable environment. Once code is deployed to a Lambda, there is no need to manage the underlying operating system or hardware. This is where the term serverless
comes from, as the developer is no longer responsible for how and where the code runs.
Lambdas can execute code written in a variety of languages, and for this guide, we create a simple Node.js Lambda.
The source code