Skip to content
Français

createAwsSecretSource

import { createAwsSecretSource } from "@elie-laloum/outpost/secrets/aws";

Create a host-side AWS Secrets Manager reader using a caller-owned SDK client. Read only selected mappings with GetSecretValue, preserve version selectors and optionally extract an own field from a JSON SecretString. Refuse binary secrets and invalid fields; pass cancellation to the SDK. No identity is installed in the sandbox.

Complete example and detailed rules.

  • optionsRequired
    AwsSecretSourceOptions
    Host client or connection configuration and explicit secret selection for the Aws adapter.
  • options.clientRequired
    Pick<SecretsManagerClient, "send">
    Caller-owned SecretsManager SDK client, authenticated on the host. The adapter uses only send with GetSecretValueCommand and passes abortSignal; it never destroys the client.
  • options.secretsRequired
    Readonly<Record<string, AwsSecretReference>>
    Explicit mapping from environment identifiers to AWS secret IDs or ARNs and optional field/version selectors. The complete selection is checked before a read, and mappings are snapshotted at construction.

SecretSource

export declare function createAwsSecretSource(
  options: AwsSecretSourceOptions,
): SecretSource;