我正在向现有 Cognito 用户池添加新触发器,但是当对其使用“existing: true”时,部署失败并出现以下错误:
Environment: darwin, node 16.16.0, framework 3.35.2 (local), plugin 7.0.5, SDK 4.4.0
Credentials: Local, "XXX-XXXX" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
CREATE_FAILED: CustomDashresourceDashexistingDashcupLambdaFunction (AWS::Lambda::Function)
Resource handler returned message: "Function creation failed because the function already exists" (RequestToken: XXXXX-XXXX-25bb-XXX-07099XXX, HandlerErrorCode: AlreadyExists)
我已遵循官方文档docs-providers-aws-events-cognito-user-pool#forcing-deploying-of-triggers
postConfirmation:
handler: triggers.postConfirmation
events:
- cognitoUserPool:
pool: ${self:custom.userPoolName}
trigger: PostConfirmation
existing: true #here's the issue