Create a custom SpringBoot based API Gateway or use AWS API Gateway?



I have already a working app deployed in AWS and I'm using an API gateway with OpenAPI approach and is done in SpringBoot. So far is working super good and everything goes smooth. Now I need to create another stack of services that will be part of my main app, but since those services will manage a completely different things I need to create a new API Gateway to manage only that part.

I did some tests trying to use an AWS Gateway using it on my (IAC) but I found a little bit difficult to configure with an OpenAPI approach in the OpenAPI contract. Also I found a little bit difficult to configure it with my Cognito user pool authorizer to authorize the requests with the accessToken. For the other hand, in my already existing SpringBoot API gateway I have more control of everything.

What is the best approach? Create another SpringBoot based API Gateway? Or use AWS Gateway?

1 Answer


API Gateway allows for the rapid definition of APIs without the need for extensive coding, making use of serverless technologies to streamline API development on AWS. Please refer this blog below to understand how you can implement as per Open API standards.

Additional benefits of Amazon API Gateway include flexibility in defining security controls, scalability and monitoring. For your specific use-case, it can also help avoid frequent patching & upkeep of your spring boot api gateway.


profile pictureAWS
answered 4 months ago
  • And how can I define in my OpenAPI contract the internal endpoints to which the request should be redirected? I saw this x-amazon-apigateway-integration for the OpenAPI contract, but I didn't find any examples for Rest type APIs, only for Lambdas

  • If my understanding is right, you are looking to a custom backend e.g. an http service on EC2 instance etc. In this case you could use x-amazon-apigateway-integration as an extension to your Open API definition as below [I have extended the example provided on the blog] PLease adapt it as per your usecase. I hope this clarifies.


      summary: List all my sports equipment
          description: Successful operation
                type: array
                  $ref: '#/components/schemas/Item'
            statusCode: '200'
        uri: http://<domain>/itemstore/items
        passthroughBehavior: when_no_match
        httpMethod: GET
        type: http

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions