Bshr Ramadan
09/28/2021, 7:06 PMlib/Api.js
?Frank
Bshr Ramadan
09/28/2021, 7:33 PMFrank
Script
construct. Ppl use it to do things like seeding the database. It should work well for seeding the user pool.Frank
Script
to run after the deploy - https://docs.serverless-stack.com/constructs/Script#running-after-deployFrank
Bshr Ramadan
09/28/2021, 7:57 PMBshr Ramadan
09/30/2021, 1:29 AMCREATE_IN_PROGRESS
I put the script in lib/Api.js
constructor like so:
const script = new sst.Script(this, 'CreateUsers', {
function: 'scripts/createUsers/index.handler',
params: {
// params
}
},
});
and the handler is something like this:
exports.handler = async (event, context) => {
return Promise.all(users.map(async (user) => await createUser({
// user fields
})));
}
and logs of the script's lambda function is empty.
so did I miss something?Frank
CREATE_IN_PROGRESS
?Frank
Bshr Ramadan
09/30/2021, 3:31 PMCREATE_IN_PROGRESS