| 1 | import type * as config from "@distilled.cloud/aws/config-service"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `config:GetResourceConfigHistory` — read the list of |
| 7 | * configuration items (change history) AWS Config recorded for a resource, |
| 8 | * newest first. |
| 9 | * |
| 10 | * Provide `Config.GetResourceConfigHistoryHttp` on the hosting Lambda Function to |
| 11 | * satisfy the requirement. |
| 12 | * ### Reading Resource Configurations |
| 13 | * **Example:** Read a Resource's Configuration History |
| 14 | * ```typescript |
| 15 | * // init — grants config:GetResourceConfigHistory |
| 16 | * const getResourceConfigHistory = yield* AWS.Config.GetResourceConfigHistory(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const result = yield* getResourceConfigHistory({ |
| 20 | * resourceType: "AWS::S3::Bucket", |
| 21 | * resourceId: "my-bucket", |
| 22 | * limit: 10, |
| 23 | * }); |
| 24 | * console.log(result.configurationItems?.length); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface GetResourceConfigHistory extends Binding.Service< |
| 30 | GetResourceConfigHistory, |
| 31 | "AWS.Config.GetResourceConfigHistory", |
| 32 | () => Effect.Effect< |
| 33 | ( |
| 34 | request: config.GetResourceConfigHistoryRequest, |
| 35 | ) => Effect.Effect< |
| 36 | config.GetResourceConfigHistoryResponse, |
| 37 | config.GetResourceConfigHistoryError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | |
| 42 | export const GetResourceConfigHistory = |
| 43 | Binding.Service<GetResourceConfigHistory>( |
| 44 | "AWS.Config.GetResourceConfigHistory", |
| 45 | ); |