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