question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cognitoUserPool with existing true create another userpool

See original GitHub issue

This is a Bug Report

Description

  • What went wrong?

If I use existing:true on a Cognito User Pool event, the userpool is created instead using that

  • What did you expect should have happened?

Should use the existing one

  • What was the config you used?
functions:
  preSignUp:
    handler: src/preSignUp.handler
    memorySize: 128
    timeout: 10
    layers:
      - { Ref: AuthToolsCommonLambdaLayer }
    events:
      - cognitoUserPool:
          pool: myUserPoolName
          trigger: PreSignUp
          existing: true
  • What stacktrace or error message from your provider did you see?

Similar or dependent issues:

Additional Data

  • Serverless Framework Version you’re using: 1.50.0
  • Operating System: Mac OS

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:38 (15 by maintainers)

github_iconTop GitHub Comments

8reactions
morglercommented, Oct 29, 2020

@medikoo thanks. I figured it out and it worked by just using the plain name given to the user pool without any prefixes.

Might be helpful on this case for people also getting the error: use the plain name without prefixes (not the ID, not the ARN).

4reactions
adil-uddincommented, Jun 7, 2020

@medikoo @pmuens is it possible to use findUserPoolById instead of findUserPoolByName to get existing Cognito user pools ? Currently, it seems the event only works when we use userPoolName instead of Id or Arn. I run multiple microservices in my app and use Outputs to refer to resources and we can only output the Arn or the Id of the user pool.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to specify an existing cognito user pool in servreless. ...
My question is how can I specify an existing user pool in serverless.yml? I don't need serverless to create a new pool for...
Read more >
Change the Attributes of an Amazon Cognito User Pool - AWS
Instead, create a new user pool with the attributes that you want to require for user registration. Then, migrate existing users to the...
Read more >
Add an existing Amazon Cognito user pool and ... - YouTube
In general when we tend to have one Amazon Cognito resource shared between multiple client applications and if we use the Amplify CLI...
Read more >
Use same Cognito UserPool with Lamda Function and ...
If you have created a Cognito User Pool resource which follows this format ... poolName} trigger: PreSignUp existing: true. No need to add...
Read more >
How to quickly set up a Cognito User Pool with custom ...
An error occurred: CognitoUserPool - Existing schema attributes cannot be modified or deleted. Now finally, with all that work, having deleted and recreated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found