As shown in the photo below, I can reach the localhost elasticsearch, however, when I try to reach it with AWS public url:9200, it denies my connection.
May I know how to connect to the AWS server's elasticsearch?
Probably you are running with default settings where elasticsearch is only bound to localhost. Which means that no one else than localhost can actually connect to it.