Skip to content
Français

createGcpSecretSource

import { createGcpSecretSource } from "@elie-laloum/outpost/secrets/gcp";

Create a Google Cloud Secret Manager reader using a caller-owned SDK client. Access only selected complete version resources, including regional names, and decode bytes or REST base64 into strict UTF-8. Refuse missing or invalid text; cancellation through fromSecrets stops waiting while an in-flight SDK call may finish.

Complete example and detailed rules.

  • optionsRequired
    GcpSecretSourceOptions
    Host client or connection configuration and explicit secret selection for the Gcp adapter.
  • options.clientRequired
    Pick<SecretManagerServiceClient, "accessSecretVersion">
    Caller-owned SecretManagerServiceClient authenticated on the host; only accessSecretVersion is used. fromSecrets bounds waiting but cannot cancel an already-started SDK call; the caller closes the client.
  • options.secretsRequired
    Readonly<Record<string, string>>
    Environment-name mapping to projects/<project>/secrets/<secret>/versions/<version>, optionally with locations/<location> after the project. Version is latest or a positive integer; only selected resources are accessed.

SecretSource

export declare function createGcpSecretSource(
  options: GcpSecretSourceOptions,
): SecretSource;