15

I have been looking at the console’s billing as far as Cloud SQL and the VM Instance is concerned. I see that a lot of the cost comes from the idling hours of the Cloud SQL IP address. I am unsure as to where the settings are for this as i have tried to “unassign” the ip address that is associated with my Cloud SQL Instance. Are these charges static, as in am I always, no matter what, going to be charged for the ip address constantly or is there a way to turn this off when I am not using the Cloud SQL Instance? If so, how can I?

superuserdo
  • 1,375
  • 3
  • 17
  • 33
  • The IP address will always be charged when the instance is not running. You can unassign an IP address to prevent this idle charge. – Tony Tseng Aug 14 '14 at 18:29

4 Answers4

7

You will be charged $0.01 for every hour the instance is not active and has an IPv4 address assigned. You can un-assign IP address using the Google Developers Console, go to your Cloud SQL instance, click on Edit and uncheck 'Assign an IPv4 address to my Cloud SQL instance' box.

Kamran
  • 3,047
  • 23
  • 40
  • 6
    Ironically the cost for IP idling is greater than the cost of leaving a small instance (e.g. SQL) running. The cost for the idling comes as a surprise and there is no obvious way to unassign the IP address for an unused instance. Google should make this more transparent. – songololo Aug 05 '18 at 09:28
  • 1
    This no longer seems to work in the current GCP console. Where might one find the option to remove the assigned IP address short of deleting the cloud SQL instance? – songololo Aug 05 '18 at 09:31
  • Paging Kamran. Is this no longer possible? – Drazen Bjelovuk Feb 12 '19 at 15:37
  • There doesn't seem to be an option "Assign an IPv4 address..." – Sam Mar 14 '19 at 06:42
  • 1
    There's not a chance to disable Public IP Address, Google doesn't allow to save changes once you uncheck "Public IP". I guess that's how Google makes profit from all GCP users. – mmarquezvacas Oct 02 '19 at 13:32
3

Click your SQL instance to go to Instance details > Connections > Public IP - uncheck it.

https://cloud.google.com/sql/docs/mysql/configure-ip

Note: When you disable public IP for an instance, you release its IPv4 address. If you later reenable public IP for this instance, it will get a different IPv4 address, and all applications that use the public IP address to connect to this instance must be modified.

Basically if you remove the public connection to your instance the IP is released too.

2

A lot of answers, most of them partial (or old?), it seems. On top, Google's settings aren't very transparent either. I checked in early 2020 and it doesn't seem possible to switch off the IP address or avoid the charges on a stopped instance.

In more detail:

  • I was billed €6.55 for 600 hours of SKU IP address idling in seconds for DB
  • The Cloud SQL instance in question was turned off (most or all of) the month of December until right now
  • Both Private IP and Public IP were deselected under [Google Cloud Project] > SQL > Connections

I then started the instance; no IP selected still. I let it run for some minutes and stopped it.

  • In the instances overview (only visible when switching from some other section like Logging back to [Google Cloud Project] > SQL), there was an IP listed under Public IP Address now
  • In [Google Cloud Project] > SQL > Connections, Public IP was selected (I didn't select anything there!)

Starting the instance now doesn't let me deselect both IP address options at the same time anymore like I had it before.

I do have a number of Authorized Networks configured under option Public IP and used these in some earlier months. I cannot test whether removing all if these will let me disable the option right now, as I need them again real soon. So, that's an open question.

In summary, besides a glitch in the system where no IP address option is selected, yet one is set up anyways, the charge seems to be unavoidable for a non-running instance. It's not possible to switch the IP off as @Tony Tseng suggested.

Why is that again, Google?

marco
  • 880
  • 10
  • 21
  • Did you check my solution too? –  Jan 11 '20 at 13:21
  • 1
    As I said, it's not possible to just uncheck the public IP. The UI requires you to have one of the two options selected, and you don't want to switch on the private IP (and if only because of the warning that this cannot be undone). – marco Jan 12 '20 at 19:03
-1

https://cloud.google.com/sql/docs/mysql/configure-ip

Click the instance name to open its Instance details page.
Select the Connections tab.
Deselect the Public IP checkbox.
Click Save to update the instance.==> Save is disabled on unchecking Public IP checkbox. Looks like either Private IP or Public IP checkbox should be selected to enable Save button.

SGuru
  • 1