Skip to content

GetContextKeysForPrincipalPolicy

Source: src/AWS/IAM/GetContextKeysForPrincipalPolicy.ts

Runtime binding for iam:GetContextKeysForPrincipalPolicy — list the condition context keys referenced by all policies attached to an existing IAM user, group, or role, so a principal simulation can be primed with the right ContextEntries.

The principal (PolicySourceArn) is chosen per request, so the binding takes no arguments and grants iam:GetContextKeysForPrincipalPolicy on *. Provide the implementation with Effect.provide(AWS.IAM.GetContextKeysForPrincipalPolicyHttp).

// init
const getContextKeys = yield* IAM.GetContextKeysForPrincipalPolicy();
// runtime
const { ContextKeyNames } = yield* getContextKeys({
PolicySourceArn: roleArn,
});