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