Skip to content

GetSnapshotLimits

Source: src/AWS/DirectoryService/GetSnapshotLimits.ts

Runtime binding for the GetSnapshotLimits operation (IAM action ds:GetSnapshotLimits), scoped to one Directory.

Reads the bound directory’s manual snapshot limits — how many manual snapshots exist versus the allowed maximum — so a backup function can prune before taking a new snapshot. The directory id is injected from the binding. Provide the implementation with Effect.provide(AWS.DirectoryService.GetSnapshotLimitsHttp).

// init — bind the operation to the directory
const getSnapshotLimits = yield* AWS.DirectoryService.GetSnapshotLimits(directory);
// runtime
const { SnapshotLimits } = yield* getSnapshotLimits();
if (SnapshotLimits?.ManualSnapshotsLimitReached) {
yield* Effect.logWarning("manual snapshot limit reached");
}