Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: do not send location ID when it is not defined

adilsonb1ba08555baa
diff --git a/docs/integrations/secret-syncs/gcp-secret-manager.mdx b/docs/integrations/secret-syncs/gcp-secret-manager.mdx
index 1ef31c9974..f19ceff5f9 100644
--- a/docs/integrations/secret-syncs/gcp-secret-manager.mdx
+++ b/docs/integrations/secret-syncs/gcp-secret-manager.mdx
@@ -37,8 +37,10 @@ description: "Learn how to configure a GCP Secret Manager Sync for Infisical."
- **GCP Connection**: The GCP Connection to authenticate with.
- **Project**: The GCP project to sync with.
- **Scope**: The GCP project scope that secrets should be synced to:
- - **Global**: Secrets will be synced globally; available to all project regions.
- - **Region**: Secrets will be synced to the specified region.
+ - **Global**: Secrets are available across all project regions. By default GCP uses automatic replication. You can optionally pin the data to specific regions using **Replica Regions** (see below).
+ - **Region**: Secrets are stored in a single specified region.
+ - **Replica Regions** (Global scope only): An optional list of regions used for GCP [user-managed replication](https://cloud.google.com/secret-manager/docs/choosing-replication#user_managed). Leave this empty to use GCP automatic replication, or select one or more regions to control where your secrets are stored. This setting only applies to secrets created after it is configured, because GCP does not allow changing a secret's replication policy once the secret exists.
+ - **Region** (Region scope only): The single region that secrets should be synced to.
5. Configure the **Sync Options** to specify how secrets should be synced, then click **Next**.
![Configure Options](/images/secret-syncs/gcp-secret-manager/gcp-secret-manager-options.png)
@@ -71,6 +73,13 @@ description: "Learn how to configure a GCP Secret Manager Sync for Infisical."
To create a **GCP Secret Manager Sync**, make an API request to the [Create GCP
Secret Manager Sync](/api-reference/endpoints/secret-syncs/gcp-secret-manager/create) API endpoint.
+ The `destinationConfig` object accepts the following fields:
+
+ - **scope** (`global` | `region`): How secrets are stored in GCP Secret Manager.
+ - **projectId**: The ID of the GCP project to sync to.
+ - **userReplicaLocationIds** (Global scope, optional): A list of region IDs (for example `["us-west4", "us-east1"]`) used for user-managed replication. If omitted or empty, GCP automatic replication is used. This applies only to secrets created after it is set.
+ - **locationId** (Region scope): The single region ID (for example `"us-west4"`) that secrets should be synced to.
+
### Sample request
```bash Request
diff --git a/frontend/src/components/secret-syncs/forms/schemas/gcp-sync-destination-schema.ts b/frontend/src/components/secret-syncs/forms/schemas/gcp-sync-destination-schema.ts
index cebcda9df6..89bb9cf9a1 100644
--- a/frontend/src/components/secret-syncs/forms/schemas/gcp-sync-destination-schema.ts
+++ b/frontend/src/components/secret-syncs/forms/schemas/gcp-sync-destination-schema.ts
@@ -11,7 +11,10 @@ export const GcpSyncDestinationSchema = BaseSecretSyncSchema().merge(
z.object({
scope: z.literal(GcpSyncScope.Global),
projectId: z.string().min(1, "Project ID required"),
- locationId: z.string().optional(),
+ locationId: z
+ .string()
+ .optional()
+ .transform((val) => val || undefined),
userReplicaLocationIds: z.string().array().optional().default([])
}),
z.object({