Skip to content

GetDirectoryLimits

Source: src/AWS/DirectoryService/GetDirectoryLimits.ts

Runtime binding for the GetDirectoryLimits operation (IAM action ds:GetDirectoryLimits).

Reads the account’s directory limits for the current region — how many cloud directories exist versus the allowed maximum — so an ops function can alert before directory creation starts failing. The action does not support resource-level permissions, so the grant is account-wide. Provide the implementation with Effect.provide(AWS.DirectoryService.GetDirectoryLimitsHttp).

// init — request the account-level capability
const getDirectoryLimits = yield* AWS.DirectoryService.GetDirectoryLimits();
// runtime
const { DirectoryLimits } = yield* getDirectoryLimits();
if (DirectoryLimits?.CloudOnlyDirectoriesLimitReached) {
yield* Effect.logWarning("directory limit reached");
}