Securing API Gateway Endpoints with Custom Lambda Authorizers

Securing API Gateway Endpoints with Custom Lambda Authorizers
Securing API Gateway Endpoints with Custom Lambda Authorizers

CLOUD LABS



Securing API Gateway Endpoints with Custom Lambda Authorizers

In this Cloud Lab, you’ll build and secure an API Gateway endpoint with custom token-based and JWT-based Lambda authorizers and caching.

9 Tasks

beginner

1hr 30m

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

Hands-on experience deploying a REST API with API Gateway
Working knowledge of using token-based Lambda authorizer function
Working knowledge of using a JWT-based Lambda authorizer function
Hands-on experience configuring API Gateway methods to use custom authorizers and enable caching

Technologies
API Gateway logoAPI Gateway
Lambda logoLambda
Cloud Lab Overview

AWS API Gateway is a fully managed AWS service that makes it easy to create, publish, maintain, monitor, and secure REST APIs at any scale. API Gateway lets you plug in custom Lambda authorizers to enforce custom access control logic at the edge. These serverless Lambda functions validate incoming requests using tokens, JWTs, or any custom scheme you define. Combining Lambda authorizers with API Gateway’s built-in caching can achieve robust security and low-latency performance for your APIs.

In this Cloud Lab, you’ll build a secure REST API Gateway endpoint with custom Lambda authorizers and enable caching for improved performance. You’ll create authorizers with two different authorization mechanisms: a token-based authorizer and a JWT-based authorizer, then integrate them with your REST API methods to enforce security at the edge. You’ll also practice testing endpoints under valid and invalid conditions to ensure your API correctly handles authorized and unauthorized access.

Below is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab:

Securing API Gateway using Lambda authorizers
Securing API Gateway using Lambda authorizers
Cloud Lab Tasks
1.Introduction
Getting Started
2.Set Up a REST API Gateway Endpoint
Create a REST API
Deploy the API and Test Its Response
3.Set Up Different Authorization Strategies for the Rest API
Implement Token-Based Lambda Authorizer Function
Integrate and Test Token Authorizers
Implement JWT-Based Lambda Authorizer Function
Integrate and Test JWT Authorizer
4.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Before you start...

Try these optional labs before starting this lab.

Relevant Course

Use the following content to review prerequisites or explore specific concepts in detail.

Hear what others have to say
Join 1.4 million developers working at companies like