@effect-aws/client-cloudtrail
v1.1.0
Published
[![npm version](https://img.shields.io/npm/v/%40effect-aws%2Fclient-cloudtrail?color=brightgreen&label=npm%20package)](https://www.npmjs.com/package/@effect-aws/client-cloudtrail) [![npm downloads](https://img.shields.io/npm/dm/%40effect-aws%2Fclient-clou
Downloads
290
Readme
@effect-aws/client-cloudtrail
Installation
npm install --save @effect-aws/client-cloudtrail
Usage
With default CloudTrailClient instance:
import { CloudTrail } from "@effect-aws/client-cloudtrail";
const program = CloudTrail.listTrails(args);
const result = pipe(
program,
Effect.provide(CloudTrail.defaultLayer),
Effect.runPromise,
);
With custom CloudTrailClient instance:
import { CloudTrail } from "@effect-aws/client-cloudtrail";
const program = CloudTrail.listTrails(args);
const result = await pipe(
program,
Effect.provide(
CloudTrail.baseLayer(() => new CloudTrailClient({ region: "eu-central-1" })),
),
Effect.runPromise,
);
With custom CloudTrailClient configuration:
import { CloudTrail } from "@effect-aws/client-cloudtrail";
const program = CloudTrail.listTrails(args);
const result = await pipe(
program,
Effect.provide(CloudTrail.layer({ region: "eu-central-1" })),
Effect.runPromiseExit,
);
or use CloudTrail.baseLayer((default) => new CloudTrailClient({ ...default, region: "eu-central-1" }))