hello guys, I am trying to create an AWS lambda fu...
# aws
f
hello guys, I am trying to create an AWS lambda function but I am getting the error: “handler and runtime must be set when PackageType is Zip”, as you can see in the next code, those properties are defined, do you know how can fix it? 🙏
Copy code
// Lambda Function
const lambdaFunction = new aws.lambda.Function("myLambdaFunction", {
    runtime: aws.lambda.NodeJS18dXRuntime,
    code: new pulumi.asset.AssetArchive({
        ".": new pulumi.asset.FileArchive(path.join(__dirname, "lambda")),
    }), // Path to the folder to zip
    timeout: 300,
    handler: "index.handler",
    role: lambdaRole.arn,
    environment: {
        variables: {
            S3_BUCKET: s3Bucket.id,
            DYNAMO_TABLE: dynamoTable.name
        },
    },
});
b
I use
runtime: 'nodejs18.x'
. `aws.lambda.NodeJS18dXRuntime`seems to be undefined at least for me
q
@full-lock-18442. Can you try using
aws.types.enums.lambda.Runtime.NodeJS18dX
instead? That's import path for the runtime enum
f
you are right @quick-house-41860, Thank you!