Parameters: CognitoUserPoolName: Type: String Default: MyUserPool Resources: MyCognitoUserPool: Type: AWS::Cognito::UserPool Properties: UserPoolName: Ref: CognitoUserPoolName Policies: PasswordPolicy: MinimumLength: 8 UsernameAttributes: - email Schema: - AttributeDataType: String Name: email Required: false PreSignupLambdaFunction: Type: AWS::Serverless::Function Properties: InlineCode: | exports.handler = async (event, context, callback) => { event.response = { autoConfirmUser: true } return event } Handler: index.handler MemorySize: 128 Runtime: nodejs14.x Timeout: 3 Events: CognitoUserPoolPreSignup: Type: Cognito Properties: UserPool: Ref: MyCognitoUserPool Trigger: PreSignUp Outputs: Region: Description: Region Value: Ref: AWS::Region PreSignupLambdaFunctionArn: Description: lambda Function Arn Value: Fn::GetAtt: [PreSignupLambdaFunction, Arn] CognitoUserPoolId: Description: Cognito User Pool Id Value: Ref: MyCognitoUserPool Metadata: SamTransformTest: true