Ras*_*adi 2 amazon-web-services amazon-cognito aws-lambda serverless
我对无服务器还很陌生,我正在尝试从无服务器 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.verifyResponse
resources:
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)
小智 5
LambdaConfig:
DefineAuthChallenge:
Fn::GetAtt: [ T-challenge-defineLambdaFunction, Arn ]
CreateAuthChallenge:
Fn::GetAtt: [ T-challenge-createLambdaFunction, Arn ]
VerifyAuthChallengeResponse:
Fn::GetAtt: [ T-challenge-responseLambdaFunction, Arn ]
Run Code Online (Sandbox Code Playgroud)
您还可以利用 GetAtt CloudFormation 函数来获取 lambda 函数的准确 ARN。