reactjsangularjsamazon-web-servicesaws-api-gateway

aws api gateway whitelist reactjs app ip address


Good day
Is it possible to Whitelist reactjs website ip address on aws API Gateway or any fron-end app .
I whitelisted my API ip address and it's working, my API is hosted in a container on aws ECS
I also hosted my Reactjs website in a container on aws ECS so I whitelisted the ec2 instance connected to my cluster I gave it an elastic Ip and whitelited it.

I also whitelisted my local Ip so that i can test locally my API is working but my reactjs website is not working at all and when I test to see which Ip address does reactjs uses it output an Ip I don't recognize.

I deployed the reactjs website to see if it will work on the server but still it does not work.

So I wanted to know if it is possible to whitelist a website's Ip.

Thanks in advance


Solution

  • No, it is not possible to whitelist the IP address of the application / server that is hosting the application. React applications are single page, and run in the browser of every single user. All of the code is run in, and all of the requests are made directly from, their browsers. For the react application to work with API Gateway, API Gateway would need to whitelist the IP address each user that is using the React application. Hope that helps!