我对无服务器非常陌生,我正在尝试从无服务器yaml文件为Cognito设置自定义挑战。我有以下功能functions: t-challenge-define: handler: t-auth-challenge.define t-challenge-create: handler: t-auth-challenge.create t-challenge-response: handler: t-auth-challenge.verifyResponseresources: Resources: CognitoUserPool: Type: AWS::Cognito::UserPool Properties: UserPoolName: my_user_pool_name MfaConfiguration: "OFF" UsernameAttributes: - phone_number Schema: - Name: phone_number AttributeDataType: String Mutable: false Required: true - Name: locale AttributeDataType: String Mutable: true Required: true LambdaConfig: DefineAuthChallenge: (how do i reference func here)
最佳答案
LambdaConfig:
DefineAuthChallenge: "arn:aws:lambda:${self:custom.region}:${self:custom.accountId}:function:t-challenge-define"
您需要使用上述特定格式添加arn。
关于amazon-web-services - serverless.yml如何在Cognito Lambda Config中引用lambda函数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50635782/