Google Cloud Engine with OpenVPN Server - google-compute-engine

Hello Stack Community,
I'm facing weird behavior of OpenVPN.
I'm running a OpenVPN Server on a Google Compute Engine with a Database. I would like to achive, to connect with a client via OpenVPN to the Google Compute Engine and insert data into the database.
If I'm connected to my home network everything works properly, I run OpenVPN Client as admin, get a secure connection within seconds and insert data into the database. Now the weird behavior. I'm at my parents place and using their network and my OpenVPN Client is not able to connect to my Google Compute Engine. OpenVPN Client run as admin and OpenVPN Server running on Google Cumpute Engine.
So I changed the network for the third time and I was again able to connect to my Google Compute Engine via OpenVPN.
Any Ideas why this is happening?

Related

Google Cloud App Engine stopped connecting to Cloud SQL

I've got a J2EE web application deployed to Google Cloud App Engine, which connects to a MySQL DB on Cloud SQL. All of a sudden it's stopped working. The GCP URL works fine and points to the correct web UI. I've re-tested the DB connection string on Google App Engine local host server, and it works absolutely fine. Public IP is enabled on Cloud SQL and my home network IP address is authorised. But clearly the cloud app engine code isn't talking to the Cloud SQL db.
Happy to share relevant code, but not sure what code would be helpful to share, as the app engine cloud URL is working, and the DB connection string is testing fine on localhost.
Does anyone have any trouble shooting tips on how I might get to the bottom of it? Has anything changed recently with GAE/Cloud SQL?
Thanks in advance...

Connect our Google App Engine Python API to an external MySQL database on Digital Ocean

There are already many questions about how to connect to an external MySQL database but they all focus on how to open a remote connection, which is simply fixed by enabling billing.
However none if these questions address how to open an exception in your MySQL database so that the GCP App engine can connect to it. Normally a static IP would do, except it seems static IPs are for Compute Instances VM.
It seems like the previous solution was using "Google Secure Data Connector", but it's been decommissioned.
I found something else on Google Cloud documentation that says:
Your App Engine app connects over the Internet using that external
service's public IP address.
However there is no further information and I have no idea if that address is static or ephemeral, but this documentation page seems to say the address will never be static and can not be assigned a static IP:
App Engine does not currently provide a way to map static IP addresses
to an application.
Has anyone ever succeeded? How did you set your exception on the external, non-GCP MySQL server?
AppEngine can connect to internet but with a pool of IP address. You can't define one and use always the same. If your Database has to authorize only one IP it's not yet supported.
However, you could cheat by plugging a serverless VPC Connector to your AppEngine and using a VM as proxy but the solution is ugly and I don't guaranty good response time, which is critical for a database...

Why I get inconsistent connection with MySQL Workbench and Google Cloud SQL?

I don't understand why I got inconsistent connection from my local MySQL Workbench to Google Cloud SQL.
Something, I can connect to my database the first time, sometimes, I need to try multiples times before getting a connection. Sadly, most of the time, it's not working.
Because I can rarely connect to the database, what kind of configuration can cause this problem?
Here's some infos:
My application hosted on Google Compute Engine don't have any connection problem.
My public IP (personnal computer) is added to the Authorised networks in my Google Cloud SQL instance. See: Enabling public IP and adding an authorized address
I have added a Firewall rules to allow port 3306 in Google Cloud VPC network
SSL is currently disable for the testing purpose
I followed these instructions: How to connect to your Cloud SQL instance database with MySQL Workbench
For the benefit of future readers, the result of the comments above was:
The problem was that the client was alternating between two possible external IP addresses. One had been authorized to access Google Cloud, and the other one had not been authorized.
Enable all client IP addresses to connect, and that should fix it.

MySQL Connection error Google Cloud

I deploy a node + sql application I made testes running the node app in my laptop using mysql database provided by google and the application was working fine (I needed to allow my ip address to connect) but when I deployed the application I started to receive timeout errors in my app. I solved the problem allowing any ip address to connect in my google cloud mysql instance but I not happy with this solution. Anybody can help to allow just the production node app server ip?
Thanks in advance.
If you want your API key to only be accessed from a certain IP, you can restrict it in the Developers Console.

Building a website on Google Cloud compute with cloudsql

I'm trying to move my dynamic website and database from my own VM's to the Google cloud. For the DB, I'm using the Google Cloud SQL, and for the website I made a host under compute.
The problem is, I can't seem to connect to the DB from the VM using an internal IP address. Somehow my Cloud SQL DB only has an external IP address.
I also have phpMyAdmin running on a compute VM, this machine can also only connect to the external ip address (this works, but I'm guessing is not very secure)
What am I doing wrong? Must I use the app engine instead for my website? I've done the training exercise but, to be honest, I have no clue what I was doing.
CloudSQL does not currently support private networks. You either need to connect via external IP or use CloudSQL proxy.
In order to increase security make sure to connect via SSL when using external IP.