| 1 | import type * as aa from "@distilled.cloud/aws/accessanalyzer"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `access-analyzer:CheckNoNewAccess`. |
| 7 | * |
| 8 | * Custom policy check: verifies an updated policy grants no access beyond what |
| 9 | * the existing policy allows. Provide the implementation with |
| 10 | * `Effect.provide(AWS.AccessAnalyzer.CheckNoNewAccessHttp)`. |
| 11 | * ### Custom Policy Checks |
| 12 | * **Example:** Compare an Updated Policy Against the Existing One |
| 13 | * ```typescript |
| 14 | * const checkNoNewAccess = yield* AWS.AccessAnalyzer.CheckNoNewAccess(); |
| 15 | * const result = yield* checkNoNewAccess({ |
| 16 | * existingPolicyDocument: JSON.stringify(existing), |
| 17 | * newPolicyDocument: JSON.stringify(proposed), |
| 18 | * policyType: "IDENTITY_POLICY", |
| 19 | * }); |
| 20 | * ``` |
| 21 | * |
| 22 | * @binding |
| 23 | */ |
| 24 | export interface CheckNoNewAccess extends Binding.Service< |
| 25 | CheckNoNewAccess, |
| 26 | "AWS.AccessAnalyzer.CheckNoNewAccess", |
| 27 | () => Effect.Effect< |
| 28 | ( |
| 29 | request: aa.CheckNoNewAccessRequest, |
| 30 | ) => Effect.Effect<aa.CheckNoNewAccessResponse, aa.CheckNoNewAccessError> |
| 31 | > |
| 32 | > {} |
| 33 | |
| 34 | export const CheckNoNewAccess = Binding.Service<CheckNoNewAccess>( |
| 35 | "AWS.AccessAnalyzer.CheckNoNewAccess", |
| 36 | ); |