Coder Social home page Coder Social logo

Comments (2)

btamadio avatar btamadio commented on July 18, 2024 9

I'd also like to use this feature.

Unfortunately, it seems the line you've posted here doesn't control the allowed versions for PreTokenGeneration events, as it only gets evaluated when the trigger is one of "CustomEmailSender" or "CustomSMSSender"

See:

if (customSenderSources.includes(trigger)) {

When I simply try to set the lambdaVersion in my event configuration for the PreTokenGeneration trigger, I get this error:

Warning: Invalid configuration encountered
  at 'functions.MyFunction.events.1.cognitoUserPool': unrecognized property 'lambdaVersion'

from serverless.

jrdnull avatar jrdnull commented on July 18, 2024

I was able to do this by specifying the LambdaConfig in the UserPool resource, e.g

    UserPool:
      Type: AWS::Cognito::UserPool
      Properties:
        UserPoolAddOns:
          AdvancedSecurityMode: "AUDIT"
        LambdaConfig:
          PreTokenGenerationConfig:
            LambdaArn: arn:aws:lambda:${aws:region}:${aws:accountId}:function:{$self:service}-${self:provider.stage}-preTokenGeneration
            LambdaVersion: V2_0
        ...

Also specify permission else it won't be able to invoke it

    PreTokenGenerationLambdaInvokePermission:
      Type: "AWS::Lambda::Permission"
      Properties:
        FunctionName: arn:aws:lambda:${aws:region}:${aws:accountId}:function:{$self:service}-${self:provider.stage}-preTokenGeneration
        Action: "lambda:InvokeFunction"
        Principal: "cognito-idp.amazonaws.com"

from serverless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.