Article about the connection to a MySQL GCP (Google Cloud Platform) database with:
For a private network for instance your home …
where the network id is given with the CIDR notation where:
For a public network, if you want to authorize any server in case of faas solution or in paas, just add the entire world with the following CIDR 0.0.0.0/0.
The traffic will go through public network, you need therefore to use SSL in order to encrypt the traffic and before all the login/password.
Create a Client Certificate:
You got three files:
Put the private key in a secure place.
For a connection with the mysql cli, see MySQL - SSL connection