►
From YouTube: Serverless Security With Kong's AWS Lambda Plugin
Description
This video will walk you through how to set up serverless security with Kong's AWS Lambda plugin. Install Kong Gateway: https://bit.ly/3rYb9SV
Find all referenced docs and code in this blog post: https://bit.ly/3iQxe4H
▬▬▬▬▬▬ TIMECODES ▬▬▬▬▬▬
0:00 - Intro
0:27 - Write Our Function
1:27 - Deploy Function to AWS Lambda
2:50 - Obtain Credentials for Invoking Lambda
6:51 - Configure Kong Gateway
9:20 - Add AWS Lambda Plugin to Kong
11:38 - Send HTTP Requests and Examine Results with Insomnia
13:03 - Wrap Up
#AWSLambda #APIgateway #Serverless #AWS #Lambda #KongPlugins #KongGateway #ServerlessSecurity
A
In
this
walkthrough
we're
going
to
look
at
the
aws
lambda
plug-in
for
kong
gateway,
we'll
write
a
simple
function
in
node.js
and
deploy
it
to
aws
lambda,
we'll
set
up
the
proper
im
credentials
to
invoke
that
landa
and
then
we'll
configure
con
gateway
to
associate
a
route
with
the
invocation
of
that
lambda
to
join
along
in
this
walkthrough.
You
will
need
an
aws
account
and
also
the
aws,
cli
and
kong
gateway
installed
to
your
local
machine.
A
We'll
start
by
writing
a
simple
function
which
follows
the
aws
documentation
on
the
shape
that
a
function
in
lambda
should
take.
Let's
start
in
a
text
editor,
the
exported
handler
is
a
function
that
is
called
with
an
event,
a
context
and
a
callback
we're
going
to
write
a
basic
first
iteration
of
this
function,
just
to
make
sure
we
can
invoke
it
successfully.
A
A
A
A
A
A
A
A
Now
that
our
iam
user
has
been
created
and
configured,
we
run
our
invoke
command
again.
This
time,
we're
shown
a
different
error
that
our
user
is
not
authorized
to
invoke
this
lambda
function.
So
now
we'll
go
back
to
aws
im
to
create
a
policy
permissions
to
invoke
this
function,
and
then
we
will
attach
that
policy
to
this
user.
A
A
A
Now
that
we
have
a
working
lambda
and
the
credentials
to
invoke
it
remotely,
let's
set
up
kong
gateway.
First,
we'll
install
kong
gateway
to
our
local
machine,
depending
on
your
own
environment.
The
steps
for
installing
kong
will
vary
once
you've
installed
kong,
create
a
project
folder
to
store
your
declarative
configuration
file.
A
A
A
A
And
we'll
start
up
kong
now,
if
we
send
a
curl
request
to
our
kong
proxy
address,
which
is
localhost
at
port
8000
to
the
slash
lambda
path
associated
with
our
route,
we
get
our
200
okay
response
great.
Now
we
want
to
edit
our
declarative
configuration
file
so
that
kong
uses
the
aws
lambda
plugin.
Let's
open
our
file
again.
A
First,
we
can
remove
our
upstream
service.
Our
route
no
longer
needs
to
be
associated
with
an
upstream
service,
since
requests
will
go
to
the
lambda
invocation.
Instead.
Next,
we
add
a
plugins
section.
We
add
one
plugin,
which
is
named
aws
lambda.
This
is
not
an
arbitrary
name.
This
is
the
specific
name
of
the
plugin
that
is
bundled
with
congateway.
A
A
We
also
specify
our
aws
region
and
our
function
name,
and
then
we
add
three
configuration
options
forward:
request
body
forward,
request,
headers
and
forward
request
uri.
This
will
take
any
headers
body
and
query
parameters
which
are
sent
to
kong
and
make
sure
that
that
same
data
is
sent
to
the
lambda
invocation.
A
A
A
A
In
this
final
request,
we
see
the
incoming
headers
the
incoming
query
parameters
and
the
incoming
body,
which
equals
the
json
body
that
we
sent
with
our
request,
and
that
concludes
our
walkthrough.
In
this
walkthrough.
We
set
up
a
function
in
aws
lambda,
along
with
an
im
user
and
policy
for
invoking
that
function.