-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/largeLarge work item – several weeks of effortLarge work item – several weeks of effortp1
Description
Create a lambda
Create a user pool
Assign the lambda to one of the user pool triggers
Set the permissions on the lambda to call Cognito APIs against the user pool
Get circular reference error in cdk deploy
Reproduction Steps
const postAuthentication = new lambda.Function(this, "postAuthentication", {
description: "Cognito Post Authentication Function",
runtime: lambda.Runtime.NODEJS_12_X,
handler: "postAuthentication.handler",
code: lambda.Code.asset("dist/postAuthentication"),
timeout: cdk.Duration.seconds(30),
memorySize: 256,
environment: {},
});
const userPool = new cognito.UserPool(this, userPoolName, {
....
lambdaTriggers: {
postAuthentication,
},
});
const postAuthPermissionPolicy = new iam.PolicyStatement({
actions: ["cognito-idp:AdminDeleteUserAttributes", "cognito-idp:AdminAddUserToGroup"],
resources: [userPool.userPoolArn],
});
// now give the postAuthentication lambda permission to change things
postAuthentication.addToRolePolicy(postAuthPermissionPolicy);Error Log
Cognito failed: Error [ValidationError]: Circular dependency between resources
Environment
- CLI Version : 1.31.0
- Framework Version:
- OS :
- Language : Typescript
Other
This is 🐛 Bug Report
reni11111, asterikx, codyfyi, xvvvyz, piotr-liszka and 27 more
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-lambdaRelated to AWS LambdaRelated to AWS LambdabugThis issue is a bug.This issue is a bug.effort/largeLarge work item – several weeks of effortLarge work item – several weeks of effortp1