I am Building a solution, where I have 10-15 micro-services REST Applications running in ECS Container and few will be in EC2. I am using Cognito as API Gateway authentication. Now UI Application will send the request to API Gateway, which in turn connect with REST Application and returns the response.
I have tried implementing API Gateway authentication with Cognito and I am able to connect to the REST endpoint running in EC2.
Now I need a solution like API Gateway -> Application Load Balancer -> Target Group -> ECS/EC2 will be running in Public Subnet.
How do I Configure this?
Am I following the correct approach?
To register your instances using the console
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ .
On the navigation pane, under LOAD BALANCING, choose Load Balancers.
Select your load balancer.
In the bottom pane, select the Instances tab.
Choose Edit Instances.
Select the instance to register with your load balancer.
Choose Save.
https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-load-balancer.html
https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-application-load-balancer.html
When you setup your API Gateway,
Create a proxy resource with a greedy path {proxy+}. Set ANY Method on the proxy resource. Set the endpoint URL to your ALB endpoint.
Ex. ENDPOINT URL: https://alb-example-123456789.us-east-1.elb.amazonaws.com/example/ {proxy}
For more details, refer to this links: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html https://docs.aws.amazon.com/apigateway/latest/developerguide/setup-http-integrations.html?shortFooter=true
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.