@grow-codes/aws-secrets-manager - v0.1.1
    Preparing search index...

    Class AwsSecretsManagerClient

    Client for AWS Secrets Manager on the official AWS SDK v3. Builds a SecretsManagerClient from the Grow config (region, credentials, endpoint, timeouts, retries, TLS, proxy, User-Agent, hooks) or wraps one the caller passes (sdkClient).

    Index

    The immutable configuration.

    • get sdk(): SecretsManagerClient

      The underlying AWS SDK client (escape hatch for operations not wrapped here).

      Returns SecretsManagerClient

    • Reads many secrets at once (BatchGetSecretValue). With a list of ids, lists longer than 20 are split and the values come back in request order; with { filters } every page is read. Per-secret failures are returned in errors (the call itself succeeds).

      Parameters

      Returns Promise<BatchGetResult>

    • Stops every watcher of the providers created by secrets and destroys the SDK client this instance built (never a caller-supplied one). Idempotent.

      Returns Promise<void>

    • Reads one field of a JSON secret: GetSecretValue, parse SecretString as a JSON object, return field (an exact key first, otherwise a dot path such as "db.host"). null when the field is absent; ValidationError when the value is binary or not a JSON object; NotFoundError when the secret is missing.

      Parameters

      Returns Promise<unknown>

    • Reads a secret value (GetSecretValue), by default the AWSCURRENT version. secretId is a name or ARN. NotFoundError when the secret, version or stage does not exist; ConflictError when the secret is scheduled for deletion.

      Parameters

      Returns Promise<AwsSecretValue>

    • Liveness: a signed ListSecrets {MaxResults: 1} with a short timeout and no retries. ok when AWS answers (also when the credentials are rejected: details.auth = "failed"), degraded when throttled, unhealthy on HTTP 5xx, unreachable on network errors. Throws only CancelledError (also on a closed client) and ConfigError.

      Parameters

      Returns Promise<HealthStatus>

    • Authenticated round trip (ListSecrets {MaxResults: 1}); returns the latency in ms. AuthenticationError for unknown keys or bad signatures, PermissionDeniedError when the principal may not call secretsmanager:ListSecrets.

      Parameters

      Returns Promise<number>

    • Always throws UnsupportedError: AWS Secrets Manager exposes no server version (the API contract date is the constant API_VERSION).

      Parameters

      Returns Promise<string>

    • Adds or replaces tags (TagResource).

      Parameters

      • secretId: string
      • tags: Readonly<Record<string, string>>
      • options: CallOptions = {}

      Returns Promise<void>

    • Removes tags by key (UntagResource).

      Parameters

      • secretId: string
      • tagKeys: readonly string[]
      • options: CallOptions = {}

      Returns Promise<void>