Skip to content

BatchGetEffectiveLifecyclePolicy

Source: src/AWS/OpenSearchServerless/BatchGetEffectiveLifecyclePolicy.ts

Runtime binding for the BatchGetEffectiveLifecyclePolicy operation (IAM action aoss:BatchGetEffectiveLifecyclePolicy; the action does not support resource-level scoping, so the grant is on *).

Resolves which retention LifecyclePolicy is in effect for specific indexes (identified as index/{collection}/{index}). Indexes with no effective policy are reported in effectiveLifecyclePolicyErrorDetails. Provide the implementation with Effect.provide(AWS.OpenSearchServerless.BatchGetEffectiveLifecyclePolicyHttp).

const batchGetEffectiveLifecyclePolicy =
yield* AWS.OpenSearchServerless.BatchGetEffectiveLifecyclePolicy();
const response = yield* batchGetEffectiveLifecyclePolicy({
resourceIdentifiers: [
{ type: "retention", resource: "index/logs/app-logs" },
],
});
const effective = response.effectiveLifecyclePolicyDetails?.[0];
yield* Effect.log(`retention: ${effective?.retentionPeriod}`);