Skip to content

AWS User Pool Pre token generation Lambda trigger create and delete fail #128

@wzhonggo

Description

@wzhonggo

Hi,

I'm attempting to update the runtime from nodejs20.x to nodejs24.x (as supported by #123), which required upgrading oss-serverless/serverless (osls) from version 3.52.0 to 3.61.0. However, after running "sls remove", I encountered the following error.
Image

You need to manually delete the trigger in the AWS userpool console.
When using the sls deploy command, it will remain in the CREATE_IN_PROGRESS state.
Image

serverless config

   preTokenGenerationTrigger:
     disableLogs: true
     handler: preTokenGenerationTrigger.main
     description: "Amazon Cognito invokes this trigger before token generation allowing you to customize identity token claims."
     events:
     - cognitoUserPool:
         pool:  ${file(../../../${self:custom.stage}.config.yml):COGNITO.userPoolName}
         trigger: PreTokenGeneration
         existing: true

Could someone please help investigate if this is a compatibility issue between the new nodejs24.x runtime support and Cognito custom resources in the latest osls version? Any guidance on how to resolve this deployment issue would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions