From 93192da461971561848dd4adeb76daf0b07ca53f Mon Sep 17 00:00:00 2001 From: bhandarivijay Date: Mon, 29 Dec 2025 15:03:32 +0000 Subject: [PATCH] chore:Migrate gsutil usage to gcloud storage --- README.md | 6 +++--- sample_identify_and_tag.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 82821b0..b693e56 100644 --- a/README.md +++ b/README.md @@ -267,7 +267,7 @@ it. Create a Cloud Storage bucket for storing test data and Dataflow staging location. ```shell script -gsutil mb -p ${PROJECT_ID} -l ${REGION_ID} "gs://${TEMP_GCS_BUCKET}" +gcloud storage buckets create "gs://${TEMP_GCS_BUCKET}" --project=${PROJECT_ID} --location=${REGION_ID} ``` ### Copy test data to Cloud Storage @@ -275,7 +275,7 @@ gsutil mb -p ${PROJECT_ID} -l ${REGION_ID} "gs://${TEMP_GCS_BUCKET}" You can use your own file datasets or copy the included demo dataset (`userdata.avro` or `userdata.parquet`). ```shell script -gsutil cp userdata.avro gs://${TEMP_GCS_BUCKET} +gcloud storage cp userdata.avro gs://${TEMP_GCS_BUCKET} ``` ## Compile modules @@ -381,7 +381,7 @@ The sample & identify pipeline outputs the Avro schema (or converted for Parquet ```shell script mkdir -p dlp_report/ && rm dlp_report/*.json -gsutil -m cp "gs://${TEMP_GCS_BUCKET}/dlp_report/*.json" dlp_report/ +gcloud storage cp "gs://${TEMP_GCS_BUCKET}/dlp_report/*.json" dlp_report/ ``` List all the column names that have been identified. diff --git a/sample_identify_and_tag.md b/sample_identify_and_tag.md index 2542a1a..2e509d3 100644 --- a/sample_identify_and_tag.md +++ b/sample_identify_and_tag.md @@ -161,7 +161,7 @@ page in the Cloud Console. Create a Cloud Storage bucket for storing test data and Dataflow staging location: - gsutil mb -p ${PROJECT_ID} -l ${REGION_ID} "gs://${TEMP_GCS_BUCKET}" + gcloud storage buckets create "gs://${TEMP_GCS_BUCKET}" --project="${PROJECT_ID}" --location="${REGION_ID}" ### Create Inspection Tag tempalte @@ -195,7 +195,7 @@ You can use your own file datasets or copy the included demonstration dataset (` 1. Copy the sample dataset to Cloud Storage for staging into Cloud SQL: - gsutil cp contacts5k.sql.gz gs://${TEMP_GCS_BUCKET} + gcloud storage cp contacts5k.sql.gz gs://${TEMP_GCS_BUCKET} 1. Create a new Database in the Cloud SQL instance: @@ -208,7 +208,7 @@ You can use your own file datasets or copy the included demonstration dataset (` export SQL_SERVICE_ACCOUNT=$(gcloud sql instances describe "${SQL_INSTANCE}" --project="${PROJECT_ID}" | grep serviceAccountEmailAddress: | sed "s/serviceAccountEmailAddress: //g") - gsutil iam ch "serviceAccount:${SQL_SERVICE_ACCOUNT}:objectAdmin" gs://${TEMP_GCS_BUCKET} + gcloud storage buckets add-iam-policy-binding gs://${TEMP_GCS_BUCKET} --member="serviceAccount:${SQL_SERVICE_ACCOUNT}" --role="roles/storage.objectAdmin" Learn more about [Importing data into Cloud SQL](https://cloud.google.com/sql/docs/mysql/import-export/importing#mysqldump). @@ -368,7 +368,7 @@ sensitive information. 1. Retrieve the report to your local machine: mkdir -p auto_dlp_report/ && rm auto_dlp_report/*.json - gsutil -m cp "gs://${TEMP_GCS_BUCKET}/auto_dlp_report/*.json" auto_dlp_report/ + gcloud storage cp "gs://${TEMP_GCS_BUCKET}/auto_dlp_report/*.json" auto_dlp_report/ 1. List all the column names that have been identified: