npm install --save @effect-aws/client-secrets-manager
With default SecretsManagerClient instance:
import { SecretsManager } from "@effect-aws/client-secrets-manager";
const program = SecretsManager.getSecretValue(args);
const result = pipe(
program,
Effect.provide(SecretsManager.defaultLayer),
Effect.runPromise,
);
With custom SecretsManagerClient instance:
import { SecretsManager } from "@effect-aws/client-secrets-manager";
const program = SecretsManager.getSecretValue(args);
const result = await pipe(
program,
Effect.provide(
SecretsManager.baseLayer(() => new SecretsManagerClient({ region: "eu-central-1" })),
),
Effect.runPromise,
);
With custom SecretsManagerClient configuration:
import { SecretsManager } from "@effect-aws/client-secrets-manager";
const program = SecretsManager.getSecretValue(args);
const result = await pipe(
program,
Effect.provide(SecretsManager.layer({ region: "eu-central-1" })),
Effect.runPromiseExit,
);
or use SecretsManager.baseLayer((default) => new SecretsManagerClient({ ...default, region: "eu-central-1" }))