I have an EC2 instance in a VPC which has public IP and an elastic IP as well. Now I want to use AWS API gateway to expose Flask APIs running on instance. Is it possible to do so with private link, without load balancer? If so please share any relevant article. I read many article but all seems very confusing.
PS: I don't want to allow all IPS in EC2 security group.
If any more detail required, please raise, I will provide.
EDIT1: I am adding, what steps I am seeing should be to achieve the same(I tried those as well):
- Create an VPC links for an HTTP API and select the VPC and security group in which EC2 lie.
- Create AWS cloud map and register an service and then register an service instance with EC2 Private IP and port 5000(flask port).
- Create an HTTP API Gateway, then define ANY Route and then attach integration-> select private resource-> Manual discovery-> cloud map and select instance that defined in 2nd step.
- Deploy API. It should be working, but not :(.
After that I try to do some debugging and found when I allow all IPs in EC2 SG, it started to work. (Not able to reach to any outcome), Maybe you can help here.
PS: EC2 have public IP as well.
Thanks