[英]Circular dependency between resources. Cognito - lambda trigger
我有一個 SAM 模板,在我將觸發器添加到我的 Cognito 用戶池之前,它工作正常。
我搜索了引發我的錯誤: Circular dependency between resources
我可以理解觸發器正在創建對用戶池的引用,然后出現循環依賴,但我找不到解決問題的方法。 我只需要設置我的 Cognito 用戶池的觸發器即可在創建用戶時獲取自定義消息/電子郵件。
這是我的 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
問題出在全局 function 環境變量中。 我正在調用AdminCognitoUserPool
,這就是循環依賴性上升的原因。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.