| 1 | import type * as kendra from "@distilled.cloud/aws/kendra"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Index } from "./SearchIndex.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `CreateAccessControlConfiguration` request with `IndexId` injected from the bound index. |
| 8 | */ |
| 9 | export interface CreateAccessControlConfigurationRequest extends Omit< |
| 10 | kendra.CreateAccessControlConfigurationRequest, |
| 11 | "IndexId" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for the `CreateAccessControlConfiguration` operation (IAM action |
| 16 | * `kendra:CreateAccessControlConfiguration`), scoped to one {@link Index}. |
| 17 | * |
| 18 | * Creates a named access-control configuration (user/group ACLs) on the |
| 19 | * index. Kendra designed this for runtime use: re-apply access changes |
| 20 | * to documents at query time without re-indexing them — e.g. revoke a |
| 21 | * departed user's access, then reference the returned `Id` from a |
| 22 | * document's `AccessControlConfigurationId`. |
| 23 | * Provide the implementation with |
| 24 | * `Effect.provide(AWS.Kendra.CreateAccessControlConfigurationHttp)`. |
| 25 | * |
| 26 | * ### Access Control Configurations |
| 27 | * **Example:** Create a Runtime ACL |
| 28 | * ```typescript |
| 29 | * const createAcl = |
| 30 | * yield* AWS.Kendra.CreateAccessControlConfiguration(index); |
| 31 | * |
| 32 | * const { Id } = yield* createAcl({ |
| 33 | * Name: "block-departed-users", |
| 34 | * AccessControlList: [ |
| 35 | * { Name: "departed-user", Type: "USER", Access: "DENY" }, |
| 36 | * ], |
| 37 | * }); |
| 38 | * ``` |
| 39 | * |
| 40 | * @binding |
| 41 | */ |
| 42 | export interface CreateAccessControlConfiguration extends Binding.Service< |
| 43 | CreateAccessControlConfiguration, |
| 44 | "AWS.Kendra.CreateAccessControlConfiguration", |
| 45 | ( |
| 46 | index: Index, |
| 47 | ) => Effect.Effect< |
| 48 | ( |
| 49 | request: CreateAccessControlConfigurationRequest, |
| 50 | ) => Effect.Effect< |
| 51 | kendra.CreateAccessControlConfigurationResponse, |
| 52 | kendra.CreateAccessControlConfigurationError |
| 53 | > |
| 54 | > |
| 55 | > {} |
| 56 | export const CreateAccessControlConfiguration = |
| 57 | Binding.Service<CreateAccessControlConfiguration>( |
| 58 | "AWS.Kendra.CreateAccessControlConfiguration", |
| 59 | ); |