Search code examples
python-3.xgoogle-bigquerylabelgoogle-cloud-sqlgoogle-cloud-pubsub

Applying labels to Cloud SQL , BigQuery and PubSub


We need to apply labels to following GCP Services

      Cloud SQL , BigQuery and PubSub

The number of Bigquery,Pubsub services will be more than thousand across spanning across multiple GCP projects . We will applying the labels to all resources at one go leveraging Python automation using the PATCH method from below APIs .

   https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/patch
   https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/patch
   https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/databases/patch

Any impact on Cloud SQL,BigQuery and PubSub when we apply labels to these GCP resources . We earlier applied labels to CLoud Run and Cloud functions where there is a corresponding deployment and revision/version change when we apply the labels. We are assuming there should be any impact on Cloud SQL,BigQuery and PubSub services when we apply labels. For PubSub , we pushed messages to some Topic' and then applied labels using API PATCH method. After that we pulled the messages using subscriptions and messages are retrieved successfully .

  gcloud pubsub topics publish storagecheck --message "Hello2"
  gcloud pubsub subscriptions pull stcheck --auto-ack

Please suggest for any impact on Cloud SQL , BigQuery and PubSub when we apply labels


Solution

  • There will no impact on the services when we apply the labels.

    Minor thing to consider is the number labels we can apply to particular instance, as of today we can assign up to 64 labels to each instance.

    Reference:

    https://cloud.google.com/sql/docs/mysql/label-instance

    https://cloud.google.com/pubsub/docs/labels

    https://cloud.google.com/bigquery/docs/labels-intro