Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

API Gateway, Cognito and Node.js Lambdas
API Gateway, Cognito and Node.js Lambdas
API Gateway, Cognito and Node.js Lambdas
Ebook64 pages24 minutes

API Gateway, Cognito and Node.js Lambdas

Rating: 5 out of 5 stars

5/5

()

Read preview

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.

LanguageEnglish
PublisherPublishdrive
Release dateJan 1, 2020
API Gateway, Cognito and Node.js Lambdas

Related to API Gateway, Cognito and Node.js Lambdas

Related ebooks

Programming For You

View More

Related articles

Reviews for API Gateway, Cognito and Node.js Lambdas

Rating: 5 out of 5 stars
5/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    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

    Enjoying the preview?
    Page 1 of 1