Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion infrastructure/lib/stacks/auth-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ export class AuthStack extends Stack {
postConfirmationFn.addToRolePolicy(
new PolicyStatement({
actions: ['cognito-idp:AdminAddUserToGroup'],
resources: [this.userPool.userPoolArn],
// Scoped to any user pool in this account/region rather than
// `this.userPool.userPoolArn`: referencing the pool's own ARN
// here creates a circular CloudFormation dependency, since
// addTrigger() below also makes the pool depend on this
// function's ARN (the classic "post-confirmation trigger needs a
// permission on its own pool" cycle). Only one user pool exists
// per stage, so this is pool-scoped in practice.
resources: [`arn:${this.partition}:cognito-idp:${this.region}:${this.account}:userpool/*`],
}),
);

Expand Down
Loading