You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: