Skip to content

ListRules

Source: src/AWS/Rbin/ListRules.ts

Runtime binding for rbin:ListRules.

Enumerates the Region’s Recycle Bin retention rules for a resource type (EBS_SNAPSHOT, EC2_IMAGE, or EBS_VOLUME), optionally filtered by resource tags, exclusion tags, or lock state — so a function can verify that deletion protection is in place before destructive maintenance. ListRules is an account-level list action, so the grant is on *. Provide the implementation with Effect.provide(AWS.Rbin.ListRulesHttp).

// init — grants rbin:ListRules on *
const listRules = yield* AWS.Rbin.ListRules();
// runtime
const { Rules } = yield* listRules({ ResourceType: "EBS_SNAPSHOT" });
for (const rule of Rules ?? []) {
yield* Effect.log(`${rule.Identifier}: ${rule.Description ?? ""}`);
}