This repository holds an agent implementation Java project for connecting Amazon API Gateway with API Control Plane, utilizing the Agent SDK. The key functionalities include:
- Registering Amazon API Gateway with API Control Plane.
- Retrieving Amazon API Gateway’s health status and sending it to API Control Plane.
- Publishing Amazon API Gateway’s assets to API Control Plane.
- Synchronizing assets between Amazon API Gateway and API Control Plane.
- Retrieving metrics from Amazon API Gateway to API Control Plane.
This project is developed using Java 17 and Gradle 7.4.2
If you use different versions of Java or Gradle, ensure they are compatible with each other. For details about the compatibility between Java and Gradle versions, see Compatibility Matrix.
- Implementation Overview
- How is this Repository Structured?
- Co-relation Between Amazon API Gateway and API Control Plane Terminologies
- How to Build the Gradle Project?
- How to Deploy and Run the AWS Agent as a Spring Boot application in Docker?
- How to Deploy and Run the AWS Agent in AWS Lambda?
- Best Practices
The implementation utilizes the Manual approach of Agent SDK and provides options for deploying the AWS agent as a stand-alone application. For details about the approaches and deployment modes, see Agent section in API Control Plane documentation. The implementation leverages the following Amazon services:
- AWS SDK for connection management and authentication.
- Amazon CloudWatch service for retrieving API metrics.
- Amazon CloudTrail service for retrieving API activity.
Note: The agent implementation is compatible with API Control Plane version, 11.0.5 and currently supports only the REST APIs of Amazon API Gateway.
The AWS agent can be deployed in the following ways:
- Spring Boot application
- AWS Lambda
To understand the differences between Spring Boot application and AWS Lambda deployment modes, see Differences.
For a detailed understanding of how the agent for Amazon API Gateway is implemented, see Core Implementation Logic.
The AWS agent developer can utilize this repository in the following ways:
- Use the repository directly to build and deploy the AWS agent.
- Fork the repository, customize the code as required, and then build and deploy the AWS agent.
This section outlines the Git repository's structure, highlighting the purpose of each directory. For details, see Repository structure.
This section details the relationship and equivalence between the terminologies used in Amazon API Gateway and the API Control Plane. For details, see Co-relation.
For details, see How to build?
Once the Gradle project is built, the Jars are created at the following locations for both the deployment modes:
Spring Boot application: application-<version>-SNAPSHOT is created at application / build / libs
AWS Lambda:
- lambda-layer.zip is created at functions / build / libs, which includes all dependencies to run lambda function.
- send-asset.jar is created at functions / send–asset / build / libs
- send-heartbeat.jar is created at functions / send-heartbeat / build / libs
- send-metrics.jar is created at functions / send-metrics / build / libs
This section details how to deploy the AWS agent as a stand-alone application. For details, see How to deploy?
AWS Lambda is a function as a service provided by AWS that lets you deploy and run your application without provisioning or managing servers. You are responsible only for the application code that you provide Lambda and the configuration of how Lambda runs that code on your behalf. For details about AWS Lambda, see AWS Lambda documentation.
Deploying an AWS agent in AWS Lambda lets you run the agent virtually without the need for administration of the underlying infrastructure. For details about the benefits of AWS Lambda, see AWS Lambda documentation.
For details about how to deploy and run the AWS agent in AWS Lambda, see How to deploy?
This section outlines the essential best practices for using this implementation and deploying the AWS agent. For details, see Best Practices.
- To learn about the authentication for a Spring boot application, see Authentication section.
- To learn how to create the runtime type in the API Control Plane, see Runtime Type Management Service API.