Skip to content

GetCollection

Source: src/AWS/OpenSearchServerless/GetCollection.ts

Runtime binding for the BatchGetCollection operation scoped to one collection (IAM action aoss:BatchGetCollection on the collection ARN).

Reads the bound Collection’s live detail — status, endpoints, KMS key — from inside a function runtime. Useful for discovering the data-plane collectionEndpoint at runtime. Provide the implementation with Effect.provide(AWS.OpenSearchServerless.GetCollectionHttp).

// init — bind the operation to the collection
const getCollection = yield* AWS.OpenSearchServerless.GetCollection(collection);
// runtime
const detail = yield* getCollection();
yield* Effect.log(`${detail?.status}: ${detail?.collectionEndpoint}`);