Is traffic between Google products free? - google-cloud-platform

I have seen the statement that "outbound traffic from GCP to other Google products (such as Google Drive) is free".
I would like to confirm if this statement is true?

This is only true, while transferring data on the internal network 10.0.0.0.
When using the public network (external IP), you'll be charged for the traffic.

You will find a list of all the use case for GCP to non-GCP product traffic costs at this page. Section "VM-to-Google service".
But your initial statement is correct, traffic from a VM in GCP to Drive is free regardless of if the VM has a public or private IP. That's because that traffic never leaves Google backbone

Related

Allow traffic from certain machines - Google Cloud Armor

I have a Google Cloud Run services and i would need to allow traffic from certain machine only.
I use Google cloud armor to allow IPs to access the Cloud Run service.
I have problem in adding dynamic IPs of certain machine as it keeps changing. I also searched on adding mac address to allow, but Cloud armor does not have that feature.
You cannot use MAC addresses for the Internet. The service (Cloud Armor) will never see the client's MAC address, only the MAC address of the last router (which would be a Google router). Google Cloud VPCs do not expose layer 2 information.
Cloud Run is a public service with a public URL. Restricting traffic based upon IP address is not supported by Cloud Run. You can put an HTTP Load Balancer and Cloud Armor in front, but that would not prevent traffic that goes directly to the service.
There are much better techniques to control access to public services. Google Cloud implements authorization using OAuth via Identity Aware Proxy (IAP). That is the correct method to use. Given that your clients have changing IP addresses, that is your best solution.
If I needed access control based upon IP address, I would run my service on Compute Engine using either Container Optimized OS, Docker or just natively using Apache/Nginx. You can dynamically update VPC firewall rules as the client's IP address changes with custom code.

How do I avoid Network Egress Charges from Cloud Function to Cloud SQL?

I have observed a surprising charge for network egress from Google Cloud Functions, and I'm trying to understand why it's happening and how to avoid it.
Stackdriver monitoring suggests that the problematic function is my ingest function, which reads files from a GCS bucket, processes them and inserts rows into a Cloud SQL instance. See the correlation here between network egress from the cloud function and received bytes for the SQL instance.
The function and the cloud SQL instance are both in us-central1 (though different zones within that region). The function connects to the SQL instance via the provided unix socket. The SQL instance does have a public IP address.
Based on the charges so far, I appear to be paying $0.1 per GiB, which looks like general Internet egress prices.
My only theory right now is that because of the public IP I am being charged public internet egress prices for the traffic to the SQL instance. Is this plausible? Is there some other reason for the charge? If this is true I assume the charge will go away if I disable the public IP for the SQL instance?
I was able to solve this problem by adding a private IP address for the SQL instance, a Serverless VPC Connector, and changing database connection code to use the private IP address explicitly.
Note that if the instance has both a public and private IP address, then connecting via the unix socket at /cloudsql/<instance_connection_name> will still incur egress charges. If the instance only has a private IP, the unix socket method uses the private network and does not incur charges. Therefore in order to retain a public IP and not incur egress charges from cloud functions, you'll need to use the private IP instead of the unix socket.

GCP Egress Cost from a GCP VM to Loadbalncer in the same region

I would like to know the egress pricing in order to send the traffic from the GCP VM to GCP LB. Both services are in the same region.
Please see the below flow.
GCP VM ----> GCP LB
Essentially it's egress traffic from one GCP Service to another GCP service.
This documentation should tell you all you need to know Network Service Tiers pricing
If not, please be aware that internal network traffic inside a project is free, only outbound traffic from your project to the internet needs to be payed.
If your LB is an internal one, there should be no cost.

AWS Hybrid Cloud Load Balancing the traffic

I am new to the Cloud Hybrid Model and planning to use the public cloud only when the on premise doesn't have the capacity to handle the traffic.
1) How to handle the traffic to be served from AWS public cloud? Data would be present in on premise, only the application load has to be shared between on premise and public cloud.
2) If ans for question 1 is possible, how to load balance the trafic between on premise and public cloud?
3) How the DNS is managed, on premise DNS or rout353?
1) How to handle the traffic to be served from AWS public cloud? Data
would be present in on premise, only the application load has to be
shared between on premise and public cloud.
You are misunderstanding what Hybrid Cloud is. If your data is in your datacenter and is served from your datacenter, then you are on-prem. In your scenario, you would need to route the Internet traffic thru AWS to on-prem which increases cost and latency. AWS, in this case, is just an expensive data pipe. This example could increase fault-tolerance if on-prem public Internet fails and you have the correct router setup for failover.
For public hybrid cloud, you locate your data and services both in cloud and on-prem. Then you can load balance, failover, etc.
For private hybrid cloud, you are combining cloud resources with your datacenter resources for consumption either in cloud or on-prem or both at the same time. You can combine private hybrid cloud with public hybrid cloud.
The answer to #2 and #3 depends on what you have deployed on-prem and in the cloud and how traffic needs to be routed, isolated and protected.
In a typical environment, you would implement redundant routers with multiple connections to the Internet and to your cloud provider. These connections provide fault tolerance and routing. There are many options for setting up DNS which depends on the details of the implementation. You can combine Route 53 with on-prem DNS with DNS forwarders.

Google Cloud VPS network traffic

I have a Google Cloud Compute Engine Windows VPS. I wanted to know that if i try to upload files on Google Drive from VPS will it charge me network fees.
as per the chart below I thought it will not because google cloud VPS and Google Drive is from Google and utilizing other google services from VPS is free. Please tell me if i am wrong? just wanted to confirm
Yes, you are right.
Network Egress traffic to Google products (such as YouTube, Maps, Drive), whether from a VM in GCP with a public (external) IP addresses or private (internal) IP addresses has no charge
General network pricing.
I know it used to be a promotional price but now it's in the General network pricing list as 'No charge'.