https://pulumi.com logo
#typescript
Title
# typescript
r

refined-terabyte-65361

01/18/2022, 6:35 PM
Hello I am trying to create lambda function
runtime: "go1.x"
I have code and dependencies in a directory how to run go build and zip while creating lambda function i am using typescript for pulumi
runtime: nodejs
m

millions-furniture-75402

01/18/2022, 8:06 PM
You want to use a FileArchive for your code:
Copy code
const myLambdaCode = new pulumi.asset.FileArchive("./folder");
const myLambda = new aws.lambda.Function(`myFunction`, {
    role: role.arn,
    runtime: "go1.x",
    handler: "main.handler",
    code: myLambdaCode,
});
https://www.pulumi.com/docs/intro/concepts/assets-archives/#archives
r

refined-terabyte-65361

01/18/2022, 8:17 PM
@*catmeme* Thanks for the response i tried FileArchive but some thing seems to be wrong while creating zip is there a way to save the Archive locally to see whats inside the zip file
m

millions-furniture-75402

01/18/2022, 8:22 PM
try zipping it yourself and use:
const myLambdaCode = new pulumi.asset.FileArchive("./file.zip");
4 Views