Google Cloud SQL "Idling IP Address" - google-cloud-sql

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?

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.

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.

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?

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.

Related

Google Cloud SQL External IP not static?

I've got a micro instance of a Postgresql database on Google Cloud SQL, but the external IP seems to change occasionally. I've seen no documentation that says this is going to happen. It's only inconvenient while developing, but I need to understand how to make sure it won't happen when I want to go live with a larger instance. Any info appreciated.
I'm inferring when you say "External IP" you are referring to the Public IP. The Public IP assigned to your instance will not change unless you disable the Public IP and enable it again. You can read the Documentation to know more, it says:
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.
Have an eye on your instance and double check that you are not unintentionally disabling the public IP.

How to make a Google Cloud SQL Instance accessible for any IP address?

I have just created a Google Cloud SQL instance. When I was looking on the access control of my instance, I found that if I want to access my database, I should authorize my IP address to get the right to access the database, but the problem is that my application will be deployed anywhere where the clients need, and even if I know where they will run the application and also I authorized their IP address, it (the IP) will be changed at least one time every 24 hours because it is not static IP, and then I have to re-authorize the IP again and again!
Is there any way to make the instance accessible from any IP?
Thanks
You can whitelist any subnet. You just need to enter it using CIDR notation: http://en.wikipedia.org/wiki/Cidr
In particular, you can whitelist 0.0.0.0/0 which includes all possible IP Address.
Please note that this is not recommended for security reasons. You want your access to be as restricted as possible.
This is an older post, but I noticed it on the sidebar so I figured I would add my 2c.
If you're able to use Cloud SQL Second Gen (currently in Beta) there is a new feature which allows access to the database without having to whitelist any firewalls: https://cloud.google.com/sql/docs/sql-proxy
Today, I was looking for a way to set-up an MS-SQL server for development purpose and found the similiar problem (how to allow my laptop to access).
This guide, helps.
In short, you need to allow firewall to enable EXTERNAL access to your VM instance at port 1433.

Using Google Cloud SQL without IP

It seems that to create users and databases/tables on Google Cloud SQL requires you to
download a MySQL client
get an instance IP so that you can use the client to connect to the cloud instance
But it shows that to get an IP requires you to pay extra. Is there any way around it?
Can I request an IP for setting up and then remove it later to avoid the charges?
You can add and remove the IP address at any time, and only pay for the charges accrued during the time it was active.
However, unless you are accessing it via a GAE application (which does not need to use the IP) it won't be much use without an IP.
Currently connecting via IPv6 is free:
https://cloud.google.com/sql/docs/mysql-client#connect-ipv6
If you can, we recommend that you connect to your instance over IPv6.
Each instance has an IPv6 address that is free to use. To connect over
IPv4, you must explicitly assign an IPv4 addresss to your instance,
which incurs a charge per hour idle.
You are only charged for external IP addresses for instances that are charged 'per use', and then only when they are idle.
The question is outdated.
As of August 2020 public IPv4 for Cloud SQL is free unless this IP is idle.
More about idling IP in Cloud SQL in this question

How to fix my amazon Ec-2 ip address

server running on Amazon Ec-2. The web-server acts as back end for my application. My application does a Rest call on the web-server to send or retrieve data.
I want to fix the web-server ip so that even if my web-server crashes or I restart the server I don't need to change the REST call of my application since the address will change in amazon.
My application is a mobile application, is there any way in which I can achieve this so that i can make my mobile application independent from back end .
I know there is something called Elastic Ip but I don't know what it is and how to use it.
thanks in advance.
Elastic IP provides an option to reserve IP address and assign it to your instance. This way you can always have the same IP and it is a right option for you. This article discusses some approaches on how to use them.
Also, it is free when you assign it to running instance, but you will have to pay for it monthly if you don't use it.
Update
The simple way to associate elastic IP with you instance is via console.
First allocate your address in Elastic IPs section of console
Then start your instance
Go back to Elastic IPs section, select address and click Associate Address. Then choose your running instance.

Get Azure public IP address from deployed app

I'm implementing the PASV mode in a FTP server, and I send to the client the IP address and port of the data end point. This is stupid because the IP is actually where the client is already connecting, so there ire two options:
How could I get the public IP
address from a given instance? Not
the VIP, but the public one.
How could I get the original target
IP address that the user used from
a Socket object? Considering routers and load balancers in the middle :P
An answer to any of this questions would do, although there is another way that could work... may I get the public IP address doing a DNS look up of myapp.cloudapp.net?
A fourth option would be use the Azure Management API library... but, too much trouble :P.
Cheers.
Not sure if you ever figured this out, but here's my take on it. The individual role instances are all behind the Windows Azure load balancer and have no idea what the original, outward-facing IP address is. Also, there's no Management API call that returns IP address - Get Deployment returns the URL but not the IP address. I think the only option is going to be a dns lookup.
Having said that: I don't think you can host a passive ftp server in your role instance (at least not elegantly). You may open up to 25 input endpoints on your role (up from 5 - see my recent blog post about this update), but there's manual work involved in the configuration. I don't know if your ftp application lets you limit your port range to such a small number of ports. Also:
You'd have to define each port as its own input endpoint (this is the manual labor part I mentioned) - input endpoints don't allow a port range to be specified, unlike the internal endpoints.
You'd have to specify the port number that's used internally, and the port numbers would need to be sequential
One last thing on ftp: you should be able to host an sftp server with no trouble, since all traffic comes through one port.
The hack that I'm contemplating right now is to retrieve http://www.icanhazip.com/. It isn't elegant and is subject to the availability of that service, but it gets the job done. A better solution would be appreciated!