From 33adbc0f242b5559dfddbe446775865a3239d35a Mon Sep 17 00:00:00 2001 From: Serion Jeon Date: Tue, 12 Sep 2023 09:57:03 +0100 Subject: [PATCH 1/2] add label managed by infisical --- backend/src/integrations/sync.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/integrations/sync.ts b/backend/src/integrations/sync.ts index 34cb67a22..797d83f9a 100644 --- a/backend/src/integrations/sync.ts +++ b/backend/src/integrations/sync.ts @@ -336,7 +336,7 @@ const syncSecretsGCPSecretManager = async ({ }); const res: GCPSMListSecretsRes = (await standardRequest.get( - `${INTEGRATION_GCP_SECRET_MANAGER_URL}/v1beta1/projects/${integration.appId}/secrets`, + `${INTEGRATION_GCP_SECRET_MANAGER_URL}/v1/projects/${integration.appId}/secrets?filter=labels.managed-by=infisical`, { params, headers: { @@ -391,6 +391,9 @@ const syncSecretsGCPSecretManager = async ({ { replication: { automatic: {} + }, + labels: { + "managed-by": "infisical" } }, { From 99a2203b3814b73ba5dd5a9bc02982c9a9dea798 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Wed, 13 Sep 2023 10:10:50 +0100 Subject: [PATCH 2/2] Update GCP SM docs to include note on Cloud Resource Manager API enabled requirement and label --- docs/integrations/cloud/gcp-secret-manager.mdx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/integrations/cloud/gcp-secret-manager.mdx b/docs/integrations/cloud/gcp-secret-manager.mdx index 8daa60a2a..3c1863006 100644 --- a/docs/integrations/cloud/gcp-secret-manager.mdx +++ b/docs/integrations/cloud/gcp-secret-manager.mdx @@ -40,9 +40,13 @@ Select which Infisical environment secrets you want to sync to which GCP secret ![integrations GCP secret manager](../../images/integrations/gcp-secret-manager/integrations-gcp-secret-manager-create.png) ![integrations GCP secret manager](../../images/integrations/gcp-secret-manager/integrations-gcp-secret-manager.png) + + Secrets synced from Infisical to GCP Secret Manager are automatically labeled `managed-by:infisical` to avoid overwriting existing values in GCP Secret Manager. + + Using Infisical to sync secrets to GCP Secret Manager requires that you enable - the Service Usage API in the Google Cloud project you want to sync secrets to. More on that [here](https://cloud.google.com/service-usage/docs/set-up-development-environment). + the Service Usage API and Cloud Resource Manager API in the Google Cloud project you want to sync secrets to. More on that [here](https://cloud.google.com/service-usage/docs/set-up-development-environment). @@ -90,9 +94,13 @@ Select which Infisical environment secrets you want to sync to the GCP secret ma ![integrations GCP secret manager](../../images/integrations/gcp-secret-manager/integrations-gcp-secret-manager-create.png) ![integrations GCP secret manager](../../images/integrations/gcp-secret-manager/integrations-gcp-secret-manager.png) + + Secrets synced from Infisical to GCP Secret Manager are automatically labeled `managed-by:infisical` to avoid overwriting existing values in GCP Secret Manager. + + Using Infisical to sync secrets to GCP Secret Manager requires that you enable - the Service Usage API in the Google Cloud project you want to sync secrets to. More on that [here](https://cloud.google.com/service-usage/docs/set-up-development-environment). + the Service Usage API and Cloud Resource Manager API in the Google Cloud project you want to sync secrets to. More on that [here](https://cloud.google.com/service-usage/docs/set-up-development-environment).