I'm currently using Heroku (which uses AWS) and my program needs to communicate with my own EC2 instance. I've made my EC2 instance in the same Region as Herokus', however, in order to reduce costs further I want to be able to community via the private IP address between my Heroku dyno and EC2 instance in the same Availability Zone.
I know I can restart Heroku to switch between servers and potentially different availability zones, however, is there any way to determine if they're in the same availability zone or in a different availability zone?
Potentially I can write a program that will restart Heroku to the point that it is in the same zone.