I have a simple Java servlet app, deployed to the GCP AppEngine. Under the same GCP, I have created a MySQL instance of GCP Cloud SQL.
I would like to save the value on MySQL server when someone makes an HTTP Post request. However, my Java App cannot connect to GCP Cloud SQL.
On the Cloud SQL page, it says
All apps in this project. All authorized.
However, my Java app can't connect even though they are under the same GCP Project.
When I add all the networks, it works correctly. However I don't want to do this:
What could be the reason that I can't connect to Cloud SQL from the App Engine? Is there some configuration that I need to do?