Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

UpdateIndexHttp.ts

18 lines793 Bytes

1import * as aoss from "@distilled.cloud/aws/opensearchserverless";
2import * as Layer from "effect/Layer";
3import { makeAossCollectionHttpBinding } from "./BindingHttp.ts";
4import { UpdateIndex } from "./UpdateIndex.ts";
5​
6export const UpdateIndexHttp = Layer.effect(
7 UpdateIndex,
8 makeAossCollectionHttpBinding({
9 tag: "AWS.OpenSearchServerless.UpdateIndex",
10 operation: aoss.updateIndex,
11 // IAM checks both: `aoss:UpdateIndex` for the API call, and
12 // `aoss:APIAccessAll` because the service reads the index through the
13 // collection's data plane ("Access denied to head index" without it).
14 // IAM has no narrower data-plane action; per-index permissions belong in
15 // the collection's AccessPolicy.
16 actions: ["aoss:UpdateIndex", "aoss:APIAccessAll"],
17 }),
18);