AWS API Gateway - WebSocket API + EC2 (HTTP & VPC Link & Auth & API Keys & Lambda Authorizer)

AWS API Gateway - WebSocket API + EC2 (HTTP & VPC Link & Auth & API Keys & Lambda Authorizer)

Source: YouTube · Anton Putra · published Aug 15, 2022 · 49:26

Cloud Security
No ratings yet Log in to rate
Transcript Available
Description

This video demonstrates how to build a real-time Chat App using AWS API Gateway WebSocket APIs integrated with EC2 instances 0:00. The tutorial covers creating routes, managing connections with DynamoDB, setting up private VPC integrations, and implementing security measures 0:10.

Key Takeaways:
• Create a WebSocket API with routes like $connect, $disconnect, and custom actions. Initially use Mock integration for testing and enable CloudWatch logs to debug connection errors 2:43.
• Integrate the API with a Node.js app on EC2 via HTTP. Disable proxy integration to pass the connectionId from the $context variable to the backend, allowing the server to push messages to specific clients 11:20.
• Manage user state by configuring $connect and $disconnect routes to save and remove connection IDs in a DynamoDB table, granting the EC2 instance necessary IAM permissions 20:56.
• Convert the architecture to a private integration using a Network Load Balancer and Auto Scaling Group. This ensures the backend is accessible only within the VPC and can scale based on load 28:49.
• Secure the API by implementing request validation with JSON schemas, Lambda authorizers for header authentication, and API keys with usage plans to throttle and quota requests 42:31.

By the end of the tutorial, viewers learn to deploy a secure, scalable WebSocket backend using AWS services like Network Load Balancers, Auto Scaling Groups, and Lambda authorizers.

Sources:

Generate CPE Credits

Generate a professional CPE document from this video's transcript.

Estimated credit: 1 CPE hours

Estimate uses the video runtime (1 hour ≈ 1 CPE, rounded to the nearest 0.5, minimum 0.5, maximum 2.0). The final amount can be lower after review, never higher.

Topic: Cloud Security. Commonly maps to: Security Architecture and Engineering, Communication and Network Security. Exact CISSP domains are assigned during generation.

CISSP Domain Mapping
Learning Objectives
Self-Assessment Questions
PDF Export Ready

Free account. One generation at a time, with a daily limit.

CPEBuddy is independent and not affiliated with or endorsed by ISC2, ISACA, or any certification body. Exports are formatted for common CPE submissions; acceptance is at your certification body's discretion.

Watch on YouTube

Transcript Preview

First 800 characters of the transcript

In this video, we're going to create WebSocket 
API in AWS and integrate it with EC2 instances. The next video will cover integration 
with Lambda functions. For the demo, we will create a simple Chat App with access 
to DynamoDB to save users' connection IDs and remove them when they disconnect. Also, 
we will implement a custom sendmessage WebSocket route to push messages from the server 
to the client using the user's connection id. First, we will create public HTTP 
integration with the EC2 instance using its public IP address. Then we 
will convert it to private integration with VPC Link using a Network Load 
Balancer and an Auto Scaling Group. Also, I'll show you multiple ways how to create 
and pass stage variables to your backend, including URL query parameters 
and in the body of …