https://pulumi.com logo
#aws
Title
# aws
c

chilly-receptionist-94436

01/27/2021, 5:53 PM
I'm trying to create a lambda function in typescript, but I got this error during deployment, which is not quite explanatory.
Copy code
* error creating Lambda Function: ValidationException:
    	status code: 400, request id: 65419587-ddbb-465b-9d57-afb7efb7fcb0
Anyway to get more detailed information?
b

brave-planet-10645

01/27/2021, 5:58 PM
Can you show some code please?
c

chilly-receptionist-94436

01/27/2021, 6:03 PM
Here you go
b

brave-planet-10645

01/27/2021, 6:19 PM
So in your lambda function, you need to specify the handler property:
Copy code
const ruleReportsFunc = new aws.lambda.Function("ruleReportsFunc", {
    environment: {
       variables: {
          "RULE_REPORT_BUCKET": ruleReports.bucket,
       },
    },
    code: new pulumi.asset.AssetArchive({
       ".": new pulumi.asset.FileArchive("./app"),
    }),
    runtime: "nodejs12.x",
    role: ruleReportsFuncRole.arn,
    handler: "ruleReportsFunc.ruleReportsFunc" // <-- I think this is correct, but you'll need to check
 });
but I'll create a ticket as that's not a very useful error message
👍 1
c

chilly-receptionist-94436

01/27/2021, 6:22 PM
thanks a lot!
4 Views