| 1 | import type * as imagebuilder from "@distilled.cloud/aws/imagebuilder"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `imagebuilder:GetImage`. |
| 7 | * |
| 8 | * Reads an image build version by ARN — its state (`BUILDING`, `AVAILABLE`, |
| 9 | * `CANCELLED`, `FAILED`, …) and the AMIs/containers it produced. Build |
| 10 | * versions are created dynamically by pipeline runs, so this is an |
| 11 | * account-level binding: pass the `imageBuildVersionArn` returned by |
| 12 | * `StartImagePipelineExecution` or found via `ListImagePipelineImages`. |
| 13 | * Provide the implementation with |
| 14 | * `Effect.provide(AWS.ImageBuilder.GetImageHttp)`. |
| 15 | * ### Observing Builds |
| 16 | * **Example:** Poll a Build's State |
| 17 | * ```typescript |
| 18 | * // init — account-level binding, no resource argument |
| 19 | * const getImage = yield* AWS.ImageBuilder.GetImage(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const { image } = yield* getImage({ imageBuildVersionArn }); |
| 23 | * yield* Effect.log(`build is ${image?.state?.status}`); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetImage extends Binding.Service< |
| 29 | GetImage, |
| 30 | "AWS.ImageBuilder.GetImage", |
| 31 | () => Effect.Effect< |
| 32 | ( |
| 33 | request: imagebuilder.GetImageRequest, |
| 34 | ) => Effect.Effect< |
| 35 | imagebuilder.GetImageResponse, |
| 36 | imagebuilder.GetImageError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const GetImage = Binding.Service<GetImage>("AWS.ImageBuilder.GetImage"); |