| 1 | import type * as SVC from "@distilled.cloud/aws/emr"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Cluster } from "./Cluster.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `elasticmapreduce:AddJobFlowSteps` — submits work (Spark jobs, Hive queries, custom JARs) to the bound cluster as steps. The cluster id is injected as `JobFlowId`. |
| 8 | * ### Running Steps |
| 9 | * **Example:** Submit a Spark Step |
| 10 | * ```typescript |
| 11 | * const addSteps = yield* AWS.EMR.AddJobFlowSteps(cluster); |
| 12 | * |
| 13 | * const { StepIds } = yield* addSteps({ |
| 14 | * Steps: [{ |
| 15 | * Name: "spark-pi", |
| 16 | * ActionOnFailure: "CONTINUE", |
| 17 | * HadoopJarStep: { |
| 18 | * Jar: "command-runner.jar", |
| 19 | * Args: ["spark-example", "SparkPi", "10"], |
| 20 | * }, |
| 21 | * }], |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface AddJobFlowSteps extends Binding.Service< |
| 28 | AddJobFlowSteps, |
| 29 | "AWS.EMR.AddJobFlowSteps", |
| 30 | <C extends Cluster>( |
| 31 | cluster: C, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: Omit<SVC.AddJobFlowStepsInput, "JobFlowId">, |
| 35 | ) => Effect.Effect<SVC.AddJobFlowStepsOutput, SVC.AddJobFlowStepsError> |
| 36 | > |
| 37 | > {} |
| 38 | export const AddJobFlowSteps = Binding.Service<AddJobFlowSteps>( |
| 39 | "AWS.EMR.AddJobFlowSteps", |
| 40 | ); |