| 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:GetComplianceDetailsByResource` — read the |
| 7 | * per-rule evaluation results (who evaluated the resource, when, and the |
| 8 | * verdict) for one resource. |
| 9 | * |
| 10 | * Provide `Config.GetComplianceDetailsByResourceHttp` on the hosting Lambda Function to |
| 11 | * satisfy the requirement. |
| 12 | * ### Reading Compliance |
| 13 | * **Example:** Read a Resource's Evaluation Results |
| 14 | * ```typescript |
| 15 | * // init — grants config:GetComplianceDetailsByResource |
| 16 | * const getComplianceDetailsByResource = yield* AWS.Config.GetComplianceDetailsByResource(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const result = yield* getComplianceDetailsByResource({ |
| 20 | * ResourceType: "AWS::S3::Bucket", |
| 21 | * ResourceId: "my-bucket", |
| 22 | * }); |
| 23 | * console.log(result.EvaluationResults); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetComplianceDetailsByResource extends Binding.Service< |
| 29 | GetComplianceDetailsByResource, |
| 30 | "AWS.Config.GetComplianceDetailsByResource", |
| 31 | () => Effect.Effect< |
| 32 | ( |
| 33 | request?: config.GetComplianceDetailsByResourceRequest, |
| 34 | ) => Effect.Effect< |
| 35 | config.GetComplianceDetailsByResourceResponse, |
| 36 | config.GetComplianceDetailsByResourceError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | |
| 41 | export const GetComplianceDetailsByResource = |
| 42 | Binding.Service<GetComplianceDetailsByResource>( |
| 43 | "AWS.Config.GetComplianceDetailsByResource", |
| 44 | ); |