By using AWS re:Post, you agree to the Terms of Use

Http API Gateway using stage variables on a private integration



I've been trying to use API Gateway (HTTP) to connect it with some ECS microservices. As far as I can see (using the console), I need the following:

  • Gateway -> VPC Link -> ALB -> ECS

That part is working ok, and I can attach a propper integration with no problems.

However, I have 3 ECS clusters (dev, uat, prod)

In order to connect to those environments, I had to create 3 different HTTP API GATEWAYS. Is there any way to create just 1 API Gateway and connect it to different private ECS using Stage Variables??

I managed to do it on REST API GATEWAYS, but using HTTP API GATEWAY seems impossible using the console because it forces me to choose an ALB, listener and VPC Link.

Am I missing something?

Thank you.

1 Answer

It should work. Look here for more details.

Saying that, I would recommend creating separate APIs for the different stages. Just like you created different backends, create different APIs. This way you reduce the risk that when you change something in dev it will accidentally impact production. I would even recommend creating the different environments in different accounts.

profile picture
answered 9 months ago

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