Skip to content

IsMemberInGroups

Source: src/AWS/IdentityCenter/IsMemberInGroups.ts

Runtime binding for the IsMemberInGroups operation (IAM action identitystore:IsMemberInGroups), scoped to one Instance.

Checks whether a user belongs to any of up to 100 groups in one call — the fast authorization primitive for group-gated routes. The instance’s IdentityStoreId is injected from the binding. Provide the implementation with Effect.provide(AWS.IdentityCenter.IsMemberInGroupsHttp).

// init — bind the operation to the Identity Center instance
const isMemberInGroups = yield* AWS.IdentityCenter.IsMemberInGroups(instance);
// runtime
const { Results } = yield* isMemberInGroups({
MemberId: { UserId: userId },
GroupIds: [adminGroupId],
});
const isAdmin = Results?.[0]?.MembershipExists === true;