Our API was public. We'd access it from api.domain.com
.
The service has moved to a private subnet with an Amazon VPC. The web app is hosted on a public instance which communicates via API to the private instance. How do we create an endpoint to access the API hosted on the private instance?
I believe we can access it via XXX.XX.XXX.XXX
which is the private IP address of the instance. However, we'd prefer to access it with a named endpoint such as api.domain.com
. How can we do this?
Is this as easy as editing the /etc/hosts file on the public instance?
XXX.XX.XXX.XXX api.domain.com
I worry about the scalability / reliability of this method.