简体   繁体   English

资源之间的循环依赖。 Cognito - lambda 触发器

[英]Circular dependency between resources. Cognito - lambda trigger

I have a SAM template that was working fine until I added a trigger to my cognito user pool.我有一个 SAM 模板,在我将触发器添加到我的 Cognito 用户池之前,它工作正常。

I searched about the error that is throwing me: Circular dependency between resources I can understand that the trigger is creating a reference to the user pool and then the circular dependency arises, but I can not find how to solve the problem .我搜索了引发我的错误: Circular dependency between resources我可以理解触发器正在创建对用户池的引用,然后出现循环依赖,但我找不到解决问题的方法 I only need to set the trigger of my cognito user pool to get custom messages/emails when a user is created.我只需要设置我的 Cognito 用户池的触发器即可在创建用户时获取自定义消息/电子邮件。

This is my SAM code:这是我的 SAM 代码:

 AdminCognitoUserPool:
    Type: AWS::Cognito::UserPool
    Properties:
      AutoVerifiedAttributes:
        - email
      VerificationMessageTemplate: 
          DefaultEmailOption: CONFIRM_WITH_LINK
      Policies:
        PasswordPolicy:
          MinimumLength: 8
      UsernameAttributes:
        - email
      Schema:
        - AttributeDataType: String
          Name: email
          Required: true
          Mutable: true
        - AttributeDataType: String
          Name: id
          # Required: false
          Mutable: true

  AdminCognitoChangePassword:
    Type: AWS::Serverless::Function
    Properties:
      Handler: src/handlers/config.customCognitoEvents
      Role: !GetAtt lambdaRole.Arn
      Events:
        CognitoEvent:
          Type: Cognito
          Properties:
            UserPool: !Ref AdminCognitoUserPool
            Trigger: CustomMessage

The problem was in the globals function environment variables.问题出在全局 function 环境变量中。 I was calling AdminCognitoUserPool and thats why the circular dependency was rising.我正在调用AdminCognitoUserPool ,这就是循环依赖性上升的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 跨账户 AWS Cognito Lambda 触发器 - Cross Account AWS Cognito Lambda Trigger 放大 API GraphQL 循环资源依赖 - Amplify API GraphQL Circular Resources Dependency AWS cognito 预授权 lambda 触发器 - AWS cognito pre auth lambda trigger AWS Cognito - 带有 Lambda 触发器的自定义 email 消息被覆盖 - AWS Cognito - Custom email message with Lambda trigger being overwritten AWS Cognito OAuth2 通过一些 Lambda 触发器访问 STATE 或 SCOPE 参数 - AWS Cognito OAuth2 access the STATE or SCOPE parameter by some Lambda Trigger 在 AWS Cognito PostAuthentication 触发器事件处理程序中自动获取经过身份验证的用户的 AccessToken lambda - Automatically getting AccessToken of authenticated-user in AWS Cognito PostAuthentication trigger event handler lambda 是否有可能,Cognito 用户池验证码通过 ses 使用 lambda 触发器并使用自定义 email 模板 - Is it possible,Cognito userpool verification code through ses using lambda trigger and using custom email template 使用 firebase Crashlytics 时以下任务之间的循环依赖 - Circular dependency between the following tasks while using firebase Crashlytics 使用数字值更新 AWS cognito 上的自定义用户属性(通过确认后触发器/lambda 函数) - Updating custom user attributes on AWS cognito with a number value (via a post confirmation trigger / lambda function) 面目全非 Lambda Output Cognito - Unrecognizable Lambda Output Cognito
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM