Skip to content

Alternative API Gateways

seshubaws edited this page Jan 19, 2024 · 1 revision

Invoke your application with Kong

Kong is an open-source API gateway and microservices management layer. The Kong server performs a reverse proxy to deliver client requests to upstream services. It handles tasks such as request routing, authentication, rate limiting and logging, and can be used as an alternative to Amazon API Gateway. For more information about Kong, visit it’s Marketplace profile.

Installation

  1. Decide for one of the different deployment topologies that Kong offers. For this guide, we are using Konnect. Konnect is a quick and easy way to get started as it offers a managed control plane hosted by Kong on AWS.
  2. Install the Konnect data plane on AWS Elastic Kubernetes Service (EKS). There are two ways to do this:
    1. Install using the Ingress Controller. The Kong Ingress Controller (KIC) allows you to declaratively define your Kong resources via templates, enabling you to utilize Infrastructure as Code for your application. You will also have access to the Kong GUI.
    2. Install without the Ingress Controller. In this method, you will only be able to configure your Kong resources through the Kong GUI.
  3. Deploy your AWS Serverless Java Container application. Kong is only compatible with the 1.0 payload format version, not 2.0. This means you must use the SpringBootLambdaContainerHandler.getAwsProxyHandler(Application.class) handler instead of getHttpApiV2ProxyHandler for your Serverless Java Container setup.
  4. Install the AWS Lambda plugin.
    1. If you installed Kong on EKS using the Ingress Controller, install the plugin with this documentation using the Declarative (YAML) tab.
    2. If you installed Kong on EKS without the Ingress Controller, install the plugin using this tutorial.

Test With a Curl Request

$ curl http://<kong-proxy-ip>:<exposed-port>/your/lambda/endpoint -d '{"key": "value"}'