How to create AWS Cognito userpool/users by script?

0

How to create Cognito userpool (if not exists) and add users (create/update) to the pool using script (re-enterable)? I'd like to provide the script to customer to avoid manual creation etc

2 Answers
1

In addition to the above, you can also Importing users into user pools from a CSV file.

There is another, more dynamic way to import the users via Lambda, Importing users into user pools with a user migration Lambda trigger.

profile pictureAWS
EXPERT
kentrad
answered a year ago
0

HI Oleg,

I would use CDK to leverage infrastructure as code. In particular, you can look at below construct to create a Cognito User pool: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPool.html.

To create users in that pool programmatically there are 3 options:

Hope it helps, and if does I'd appreciate if answer can be accepted, so that community can benefit for clarity when searching for similar questions, thanks ;)

profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions