Search code examples
google-cloud-platformgoogle-cloud-storage

Does renaming an object in a google cloud storage bucket cause egress charges?


I was trying to back-up some data from BigQuery to Google Cloud Storage. I've managed to copy about 10 TiBs of data. Then, as expected, I incurred egress charges. Later, I realized that I had done a mistake while backing-up the data and I had to rename each object that I had backed-up. I used a simple command to rename the folder. The next day, I checked out my billing and saw that I had incurred egress charges for approximately 10TiBs of data again.

This is the command I used to rename the folder in my bucket:

gcloud storage mv gs://bucket-name/biq-query-backups/ gs://bucket-name/bigquery-backups

I thought I would incur Class A operation charges since it is a copy operation. However, as I mentioned, I incurred egress charges for 10 TiBs of data. I also saw that I had incurred Class A operation charges as well.

I am puzzled and lost. I looked through documentation but was unable to find a satisfactory explanation. I suspect the charges may be due to my storage being multi-regional but there is no documentation about it. Can somebody explain what is going on?


Solution

  • Google Cloud Storage is idempotent. A move operation is actual a read/write/delete operation. That means that you have egress for the read, ingress for the write, plus API calls.

    Google Cloud Storage charges for egress operations. In your example, the following egress applies:

    Network egress within Google Cloud, when egress is to other Cloud Storage buckets or to Google Cloud services.

    • Region to same region egress is free. Example: US-EAST1 to US-EAST1.
    • Multi-region egress is not free.

    In North America, Cloud Storage egress within Google Cloud is $0.02/GB. Europe is $0.05/GB. Consult the link below for other bucket locations.

    Reference:

    Cloud Storage pricing - section titled "Network egress within Google Cloud".