Skip to content

GetPermissionPolicy

Source: src/AWS/WAFv2/GetPermissionPolicy.ts

Runtime binding for wafv2:GetPermissionPolicy — read the IAM policy that shares the bound RuleGroup with other accounts; the rule group ARN is injected automatically. A rule group with no policy attached fails with the typed WAFNonexistentItemException.

Provide WAFv2.GetPermissionPolicyHttp on the hosting Lambda Function to satisfy the requirement.

// init — grants wafv2:GetPermissionPolicy on the rule group
const getPermissionPolicy = yield* AWS.WAFv2.GetPermissionPolicy(group);
// runtime
const { Policy } = yield* getPermissionPolicy().pipe(
Effect.catchTag("WAFNonexistentItemException", () =>
Effect.succeed({ Policy: undefined }),
),
);