This article introduces how to deploy microservices using AWS ECS (Elastic Container Service) Fargate as the Data Plane for Kong Konnect and build an API Gateway environment.
Prerequisites
- AWS account
- Kong Konnect account
Setup Steps
On the Kong Konnect Side
Log in to Konnect, go to Gateway manager
-> Data Plane Nodes
-> Configure data plane
, and click Generate Certificate
to generate a docker run command. Copy the parameters from this command, as you will use them later.
Once the certificate is generated, the work on the Konnect side is done. The certificate and key contain line breaks, so to set them as ECS environment variables, use the following command to convert them to a single line:
|
|
On the AWS ECS Side
Container Definition
Go to AWS ECS
-> Task definitions
-> Create new task definition with JSON
to define the container.
Use the following JSON:
|
|
Based on the docker run
command, you need to update the following Kong parameters:
KONG_CLUSTER_CONTROL_PLANE
KONG_CLUSTER_SERVER_NAME
KONG_CLUSTER_TELEMETRY_ENDPOINT
KONG_CLUSTER_TELEMETRY_SERVER_NAME
KONG_CLUSTER_CERT
KONG_CLUSTER_CERT_KEY
You should also update the following parameters to match your AWS settings:
logConfiguration.options
executionRoleArn
Start the Service
After creating the cluster, create a Service.
There are a few key points when creating the Service. Set the other options as appropriate.
In
Service Details
, select the Task you just created forTask definition family
.In
Networking
, forSecurity group
, you need to open ports8000
and8443
.Since you need external access, turn on
Public IP
.
Once everything is set, click Create at the bottom right of the page.
Operation Check
Once the Service is running, you can check the ECS Data Plane in Konnect’s Data Plane Nodes
.
On the AWS ECS side, you can check the assigned Public IP
address under the Task in the Service.
If you access the address, you should get a no Route matched with those values
response, confirming that the Kong Data Plane has been successfully set up.
|
|
Summary
This article introduced how to build an API Gateway environment with the minimum configuration by running Kong Konnect’s Data Plane on AWS ECS (Fargate).
Lightweight and Resource-Efficient
Fargate can run with the minimum configuration ofCPU: 512
/Memory: 1024
No external DB required for KonnectEasy Setup
No need for complex network or load balancer configuration.
Just copy and modify the ECS Task Definition based on thedocker run
command issued by KonnectNo Management Required with SaaS Integration
Manage API routing and security centrally on Konnect (SaaS).
The data plane just needs to run as a simple reverse proxy
The combination of Kong Konnect and AWS Fargate is ideal for those who want to try an API Gateway without the hassle of infrastructure setup. No need to configure databases or load balancers, and with SaaS management and a managed runtime, you can get started easily with minimal setup. It’s simple to introduce and offers a flexible configuration that can scale as needed.