Lambdaless,
and AWS CDK
MooYeol Prescott Lee
Software Engineer @ Vingle, Inc.
• Serverless Lover 

• Loves building all kinds of
multimedia services

• Software Engineer @ Vingle

• https://github.com/mooyoul

• https://mooyoul.github.io
Who am i?
Topics
• Lambdaless
• What’s Lambdaless? When to use? How?
• Real-world Examples
• AWS CDK
• What's AWS CDK, How to use that?
• Unlocking new possibilities
Lambdaless
Lambda-less
=
Serverless architecture
without Lambda
Are you joking?
🙅
https://github.com/
mooyoul/lambdaless
Recap How Lambda can
be called via HTTP
endpoint
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
GET https://api-id.execute-api.amazonaws.com/stage/path
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
Call AWS Service API
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
Call AWS Service API
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
Call AWS Service API
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
Get file contents by calling GetObject
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
Get file contents by calling GetObject
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
Get file contents by calling GetObject
How Lambda invoked via
HTTP
AWS Lambda Amazon S3
Role
Internet
Amazon API Gateway
Role
Users
Let’s focus this part
Did you know?
API Gateway
can
call AWS Service APIs
So what? 🤷
Go back…
Lambda-less
=
Serverless architecture
without Lambda
If you need to build an URL
shortener service,
What will you do?
URL Shortener requirements
• Create Shorten ID and Store original URL
• Redirect to original URL if exists
• Collect visitor statistics
URL Shortener requirements
• Create Shorten ID and Store original URL
• Redirect to original URL if exists
• Collect visitor statistics
https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
URL Shortener requirements
• Create Shorten ID and Store original URL
• Redirect to original URL if exists
• Collect visitor statistics
S3 built-in feature
URL Shortener requirements
• Create Shorten ID and Store original URL
• Redirect to original URL if exists
• Collect visitor statistics
Turn on Access Log & Run ETL through Athena
Users
Amazon API Gateway
Amazon Cloudfront
Amazon S3
AWS Lambda
Lookup shorten id
and redirect
Store original URL
with shorten id
Store access logs
Lambda just do
simple tasks ☎
Rethink Service
Architecture 👀
Users
Amazon API Gateway
Amazon Cloudfront
Amazon S3
AWS Lambda
Lookup shorten id
and redirect
Store original URL
with shorten id
Store access logs
Users
Amazon API Gateway
Amazon Cloudfront
Amazon S3
Lookup shorten id
and redirect
Store access logs
Store original URL
with shorten id
Call S3 PutObject API
Set destination
w/ path parameter
using IAM Role
Allow S3 Access
Assign Random ID 

by referencing Request ID
Set redirect destination
Make public
Set object content with additional data
Create shorten url of 

https://www.vingle.net/mooyoul
API Response
Request Body
Upstream Endpoint URL
Set redirect location
Set Object ACL
Built Request Body
Upstream Response
c
Problem Solved ✅
So idea is…
Bring API Gateway as
First Class
Real-world Use cases
Proxy
At Vingle,
We have multiple Media
formats
Link Preview
Embedded Video
Embedded Video
Youtube
Vimeo
Naver TV Twitch Clip
Twitch VideoV LIVE
We access webpages
We access webpages
from Virginia Region
Embedded Video
Youtube
Vimeo
Naver TV Twitch Clip
Twitch VideoV LIVE
We had issues with
some websites 😭
Access denied due to Firewall Policy
(They blocked some N. Virginia CIDRs)
(Actually we got 403 Forbidden)
Timeouts due to
poor internet connectivity
We should build Proxy 🛠
It’s easy as pie 🥧
Users
Amazon API GatewayAmazon Cloudfront
AWS Lambda
3rd Party Website
Really?
Nooooo 🤯
Hidden parts
• Dependency management
• If axios is updated, We need to update axios dependency and deploy function
• Runtime management
• If Node.js runtime reaches EOL, We need to update lambda runtime and deploy
function
• Monitoring
• We need to monitor Lambda metrics
• Wasting Money
• Most of execution time: Just waiting for response
• Performance overhead & Size limitations
I don’t want to manage
Lambda either 😫
Use API Gateway
as Proxy 🛤
API Gateway
can
proxy requests 🙌
Users
Amazon API GatewayAmazon Cloudfront
AWS Lambda
3rd Party Website
Problem Solved ✅
https://github.com/
mooyoul/lambdaless/tree/
master/proxy
Another Use-case
Email Subscription ✉
You should build
subscription API 🗞
Users
Amazon API GatewayAmazon Cloudfront
AWS Lambda
Amazon Dynamo DB
Amazon RDS
Lambdaless way 💃
Users
Amazon API GatewayAmazon Cloudfront
AWS Lambda
Amazon Dynamo DB
Amazon RDS
https://github.com/
mooyoul/lambdaless/tree/
master/email-subscription
RDS can be supported
👀
https://aws.amazon.com/blogs/aws/new-data-api-for-amazon-aurora-serverless/
More use cases
• Expose Kinesis Firehose endpoint to collect data
• Collect external incoming webhook payload (e.g. SendGrid Events, Slack
Outgoing Webhook)
• Expose Amazon IoT Data endpoint to publish events
• Public Real-time messaging
• Public Event Pub/Sub Channel
• Expose Step Functions Execution endpoint
• Any else AWS API can be invoked via API Gateway
• e.g. SNS, SQS, AppSync
More real-world implementations
👇
https://github.com/mooyoul/
lambdaless
Anything else?
• Securing API Gateway
• API Key
• Cognito Integration
• Parameter Validation
• Supports OpenAPI Schema to validate payload
• Parameter Mapping
• Context Parameters
Bonus: Lambdaless
Scheduled Task
• Setup Cron Rule from CloudWatch Events
• Publish Cron Trigger Event to SNS topic
• Subscribe SNS topic and Notify Event to HTTP
Endpoint (Webhook)
• Use Webhook Endpoint as API Gateway
• It’s possible in theory, but not recommended!
Lambdaless is
NOT

a silver bullet
When to use Lambdaless
• Super simple Task
• Proxy
• Mock API
• Call single AWS Service API
When NOT to use
Lambdaless
• Anything else of “When to use Lambdaless”
• Require complex business logic
• Require data join
• Require computation
• Require non-interactive event triggers (e.g.
DynamoDB Callback)
Recap: Lambdaless
• What’s Lambdaless?
• Serverless Architecture without Lambda
• Use API Gateway as first class
• When to use Lambdaless?
• Super simple task only
• Use-cases
• URL Shortener Service, Basic CRUD API (DynamoDB), Proxy
Lambdaless Q&A
AWS CDK
https://aws.amazon.com/blogs/developer/aws-cdk-developer-preview/
https://aws.amazon.com/blogs/aws/aws-cloud-development-kit-cdk-typescript-and-python-are-now-generally-available/
What’s AWS CDK?
AWS CDK extends
CloudFormation 🤝
CDK Key Features
• Define AWS Resources in modern programming
language, not YAML
• TypeScript, Python
• Reusable Template, Abstract the details
• Easy to reference pre-existing AWS Resources
CDK Key Features
• Built-in CLI provides seamless development experience
• Easy Deploy & Packaging
• Build Docker Image & Publish to ECR
• Package lambda code
• Extended AWS Resource support
• Issue a ACM Certificate using DNS Validation
Quick Start
Initialize Application
Bootstrap AWS Environment
We have to install “bootstrap stack” per each environment
[Account + Region] to support CDK
Deploy Application
Deploy Application
Let’s build Lambda
Application with CDK
Install additional
dependencies
Edit Stack
Edit Stack
Define Lambda Function
Edit Stack
Define API Gateway API
Deploy Application
Real-world Example
Lambdaless Proxy
Users
Amazon API GatewayAmazon Cloudfront
AWS Lambda
3rd Party Website
Make Proxy Service to
Logical Resource
Define API Gateway API
Define Proxy Resource
Issue ACM Certificate
Fargate
https://aws.amazon.com/blogs/containers/containers-and-infrastructure-as-code-like-peanut-butter-and-jelly/
Dead simple example
New Possibilities
Expand Application code
to provision resources
See also
• https://github.com/aws-samples/aws-cdk-
examples
• https://cdkworkshop.com/
Q&A
Thank you! 🙇

Lambdaless and AWS CDK