happy-advantage-79856
05/15/2023, 4:42 PMerror: Error serializing function 'customMessage': index.ts(192,22)
function 'customMessage': index.ts(192,22): which could not be serialized because
Could not find [[Scopes]] property
Function code:
function customMessage(event, context) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
console.log('event', event);
if (event.triggerSource === "CustomMessage_AdminCreateUser") {
...
The Original Code:
export const customMessageLambda = new aws.lambda.CallbackFunction(
`customMessage-lambda-${stack}`, { callback: customMessage }
);
The Working Code:
export const customMessageLambda = new aws.lambda.Function(
`customMessage-lambda-new`,
{
code: new pulumi.asset.FileArchive('./customMessage.zip'),
role: 'arn:aws:iam::617706700270:role/lambdaRole-20db8e5',
handler: 'customMessage.handler',
runtime: 'nodejs12.x',
}
);
salmon-gold-74709
05/18/2023, 2:28 PM