Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Admin User bootstrap process #1

Open
jjnaude opened this issue Jun 26, 2024 · 0 comments
Open

Improve Admin User bootstrap process #1

jjnaude opened this issue Jun 26, 2024 · 0 comments
Assignees

Comments

@jjnaude
Copy link
Collaborator

jjnaude commented Jun 26, 2024

We currently use the little .bat shell script createAdminUser.bat to create the first admin user when a new instance of Detweb is brought up. That admin user can then create projects, promote other users to admins, add them to projects etc. This has a number of issues:

  • The use of a .bat shell script ties the development environment to windows. It would be preferred if we could do this in Node/Python
  • It needs to be run as a separate step. Ideally it should happen automatically as part of cdk deploy.
  • It requires two command line parameters (The ID of the Appsync API and the ID of the associated Cognito userpool). Currently the user must copy-paste these from CDK outputs. No reason why the code cannot fetch these values automatically.
  • It creates a user with a fixed name, email, temp password etc. The user should be prompted for this info in a user friendly way.
  • The regions of both cognito pool and dynamo db instances are hardcoded. These should be extracted automatically.
  • The existing script has no error-checking/error-handling.

Ideally this step could be implemented as part of the CDK script itself, but it really is a post-deploy action (we can't add a user to the cognito userpool before that pool has been created and similarly we cant write user metadata to the DynamoDB User Table before the table has been created. Still, CDK is powerful, this might be possible. I just couldn't see a quick way, so I wrote the bat script as a stopgap.

Alternatively this might be added to the existing post-deploy lambda. This is definitely possible, we might just have to add some additional rights for the lambda, get the user input with the CDK script and pass it to the Lambda as environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants