1import type * as SVC from "@distilled.cloud/aws/emr";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Cluster } from "./Cluster.ts";
5
6/**
7 * Runtime binding for `elasticmapreduce:GetClusterSessionCredentials` — mints temporary HTTP basic credentials for the bound cluster's endpoints (runtime-role / fine-grained access control clusters). The returned `Password` is `Redacted` — unwrap with `Redacted.value`.
8 * ### Connecting to the Cluster
9 * **Example:** Mint Session Credentials
10 * ```typescript
11 * const getCredentials = yield* AWS.EMR.GetClusterSessionCredentials(cluster);
12 *
13 * const { Credentials, ExpiresAt } = yield* getCredentials({
14 * ExecutionRoleArn: runtimeRoleArn,
15 * });
16 * const password = Redacted.value(
17 * Credentials!.UsernamePassword.Password! as Redacted.Redacted<string>,
18 * );
19 * ```
20 *
21 * @binding
22 */
23export interface GetClusterSessionCredentials extends Binding.Service<
24 GetClusterSessionCredentials,
25 "AWS.EMR.GetClusterSessionCredentials",
26 <C extends Cluster>(
27 cluster: C,
28 ) => Effect.Effect<
29 (
30 request?: Omit<SVC.GetClusterSessionCredentialsInput, "ClusterId">,
31 ) => Effect.Effect<
32 SVC.GetClusterSessionCredentialsOutput,
33 SVC.GetClusterSessionCredentialsError
34 >
35 >
36> {}
37export const GetClusterSessionCredentials =
38 Binding.Service<GetClusterSessionCredentials>(
39 "AWS.EMR.GetClusterSessionCredentials",
40 );