@effect-aws/client-secrets-manager
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

@effect-aws/client-secrets-manager

npm version npm downloads

Installation

npm install --save @effect-aws/client-secrets-manager

Usage

With default SecretsManagerClient instance:

import {
  SecretsManagerService,
  DefaultSecretsManagerServiceLayer,
} from "@effect-aws/client-secrets-manager";

const program = SecretsManagerService.getSecretValue(args);

const result = pipe(
  program,
  Effect.provide(DefaultSecretsManagerServiceLayer),
  Effect.runPromise,
);

With custom SecretsManagerClient instance:

import {
  SecretsManagerService,
  BaseSecretsManagerServiceLayer,
  SecretsManagerClientInstance,
} from "@effect-aws/client-secrets-manager";

const program = SecretsManagerService.getSecretValue(args);

const SecretsManagerClientInstanceLayer = Layer.succeed(
  SecretsManagerClientInstance,
  new SecretsManagerClient({ region: "eu-central-1" }),
);

const result = await pipe(
  program,
  Effect.provide(BaseSecretsManagerServiceLayer),
  Effect.provide(SecretsManagerClientInstanceLayer),
  Effect.runPromise,
);

With custom SecretsManagerClient configuration:

import {
  SecretsManagerService,
  BaseSecretsManagerServiceLayer,
  DefaultSecretsManagerClientConfigLayer,
  SecretsManagerClientInstance,
  SecretsManagerClientInstanceConfig,
} from "@effect-aws/client-secrets-manager";

const program = SecretsManagerService.getSecretValue(args);

const SecretsManagerClientInstanceLayer = Layer.provide(
  Layer.effect(
    SecretsManagerClientInstance,
    SecretsManagerClientInstanceConfig.pipe(
      Effect.map(
        (config) =>
          new SecretsManagerClient({ ...config, region: "eu-central-1" }),
      ),
    ),
  ),
  DefaultSecretsManagerClientConfigLayer,
);

const result = await pipe(
  program,
  Effect.provide(BaseSecretsManagerServiceLayer),
  Effect.provide(SecretsManagerClientInstanceLayer),
  Effect.runPromiseExit,
);

or map over DefaultSecretsManagerClientConfigLayer layer context and update the configuration...

Readme

Keywords

none

Package Sidebar

Install

npm i @effect-aws/client-secrets-manager

Weekly Downloads

187

Version

1.2.1

License

MIT

Unpacked Size

116 kB

Total Files

22

Last publish

Collaborators

  • f1oyd