Skip to content

GetRule

Source: src/AWS/Rbin/GetRule.ts

Runtime binding for rbin:GetRule.

Reads the bound retention Rule’s full detail — retention period, resource type, resource/exclusion tags, lock state, and status — so a function can audit its Recycle Bin coverage or alert on an unexpected unlock at runtime. The rule’s identifier is injected from the binding. Provide the implementation with Effect.provide(AWS.Rbin.GetRuleHttp).

// init — grants rbin:GetRule on the rule's ARN
const getRule = yield* AWS.Rbin.GetRule(rule);
// runtime
const detail = yield* getRule();
yield* Effect.log(
`rule ${detail.Identifier} retains ${detail.ResourceType} for ` +
`${detail.RetentionPeriod?.RetentionPeriodValue} days (${detail.LockState ?? "unlocked"})`,
);