AWS API Gateway - EC2 Integration (Console + Terraform | Backend | Endpoint | HTTP | Node JS)

AWS API Gateway - EC2 Integration (Console + Terraform | Backend | Endpoint | HTTP | Node JS)

Source: YouTube · Anton Putra · published Aug 2, 2022 · 44:50

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

This video demonstrates three methods to integrate AWS API Gateway with EC2 instances using both AWS console and Terraform, with the autoscaling approach being recommended for production [0:00, 29:34].

Key Takeaways:
• First example uses direct public integration, which is simple but requires exposing EC2 to the internet with no easy way to restrict access to only API Gateway [0:13, 5:36]
• Second example implements private integration using a VPC link and network load balancer, restricting access so only API Gateway can route traffic to the EC2 [0:45, 20:45]
• Third example uses an autoscaling group with network load balancer to automatically add instances when CPU usage exceeds 25% [1:05, 1:16, 33:30]
• Each approach is demonstrated first in AWS console and then implemented using Terraform [0:33, 13:41]
• The presenter uses a Node.js Express app with a health check endpoint and a Fibonacci endpoint for load testing [1:42, 3:29]

The third approach with autoscaling is ideal for production as it provides both security and scalability for REST APIs running on EC2 instances [3:24, 29:34].

Sources:

  • 0:00 Introduction to the topic of integrating AWS API Gateway with EC2
  • 0:13 Explanation of direct public integration
  • 0:33 Creating objects manually in AWS console
  • 0:45 Private integration using VPC link and network load balancer
  • 1:05 Third example using autoscaling group
  • 1:16 Autoscaling based on CPU usage
  • 1:42 Node.js Express app for demonstration
  • 3:24 Benefits for stateless applications
  • 3:29(https://www.youtube.com/watch?v=XhS2J

Generate CPE Credits

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

Estimated credit: 0.5 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, I'll show you how to integrate AWS 
API Gateway with EC2 instances using AWS console and terraform. In the first example, we will use 
direct public integration. We will create AWS API Gateway and EC2 instance that will have a public 
IP address. This is the simplest way to integrate those two services, but it has a few drawbacks. 
For example, there is no easy way to restrict that only API Gateway can access EC2; your service 
will be wide open to the Internet. First, we will create all those objects manually from the AWS 
console, and then I'll show you how to reproduce exactly the same setup using Terraform. In the 
second example, we will use private integration using a VPC link and an internal network load 
balancer. In that way, we can restrict access so that only the …