Tim V
12/09/2021, 6:57 PMconst auth = new Auth(this, "auth", {
cognito: {
userPool: {
selfSignUpEnabled: false,
signInAliases: { email: true },
customAttributes: {
PasswordUpdated: new DateTimeAttribute({ mutable: true }),
},
},
triggers: {
preAuthentication: {
handler: "stack/cognito/pre-authentication.handler",
permissions: [
new PolicyStatement({
effect: Effect.ALLOW,
resources: ["*"],
actions: [
"cognito-idp:AdminResetPassword",
"cognito-idp:UpdateUserAttributes",
],
}),
],
},
postAuthentication: {
handler: "stack/cognito/post-authentication.handler",
},
customMessage: {
handler: "stack/cognito/custom-message.handler",
environment: {
URL: "https://" + customDomain.domainName,
}
},
},
},
});
Tim V
12/09/2021, 7:06 PMFrank
attachPermissionsForTriggers()
isn’t in the doc. I’m going to add it.Tim V
12/09/2021, 8:07 PMFrank
Frank
Tim V
12/09/2021, 8:27 PMTim V
12/09/2021, 8:28 PMTim V
12/09/2021, 8:28 PMauth.attachPermissionsForTrigger("preAuthentication", [
new PolicyStatement({
effect: Effect.ALLOW,
resources: ["*"],
actions: ["*"],
}),
]);
Tim V
12/09/2021, 8:29 PMresources: [auth.cognitoUserPool.userPoolArn],
... I get a Circular Dependency error. The format is nasty, but here's the error...Tim V
12/09/2021, 8:30 PM