https://pulumi.com logo
#general
Title
# general
e

eager-area-86739

09/18/2018, 4:24 PM
Hi, I'm trying different options with Pulumi, and one of them is to upload a .NET Lambda to AWS. I can set the code from the directory where the DLL's are:
Copy code
code: new pulumi.asset.AssetArchive({
            ".": new pulumi.asset.FileArchive("./publish/TheLambda")
        }),
But I'm trying to upload a zip file that was already created by the build pipeline. However I can't find the documentation to do it. Any ideas? Cheers
w

white-balloon-205

09/18/2018, 4:29 PM
There's an example of this here: https://github.com/pulumi/examples/blob/master/aws-ts-serverless-raw/index.ts#L56 It points at:
./app/bin/Debug/netcoreapp2.0/publish
e

eager-area-86739

09/18/2018, 4:39 PM
Yeah, mine works like that. What I'm looking for is to point to a zip file, rather then a directory
w

white-balloon-205

09/18/2018, 4:59 PM
I would expect that if you ZIP up the
publish
folder, then you could do:
Copy code
code: new pulumi.asset.FileArchive("./publish.zip"),
I have not tried this yet though.
e

eager-area-86739

09/18/2018, 5:00 PM
Let me try that, and I will came back to you!
@white-balloon-205 did not work. 😞
Copy code
panic: runtime error: invalid memory address or nil pointer dereference
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x11ebc72]
s

stocky-spoon-28903

09/18/2018, 6:11 PM
If it’s available from a URL you can use
RemoteArchive
too: https://github.com/jen20/lambda-cert/blob/master/pulumi/src/index.ts#L288
But that panic is definitely a bug
e

eager-area-86739

09/18/2018, 6:12 PM
thanks
@stocky-spoon-28903
s

stocky-spoon-28903

09/18/2018, 6:13 PM
Do you have the complete panic backtrace for the segfualt @eager-area-86739?
e

eager-area-86739

09/18/2018, 6:14 PM
Yes I do.
s

stocky-spoon-28903

09/18/2018, 6:14 PM
Could you stick it in a gist? That’s something that likely wants fixing!
e

eager-area-86739

09/18/2018, 6:15 PM
Here:
<https://gist.github.com/joaoasrosa/67b3ac4e3011f1efc68f14018a566487>
Cheers
s

stocky-spoon-28903

09/18/2018, 6:16 PM
Huh… that is not what I was expecting
Can you paste the bit of calling code you had?
(It shouldn’t crash, but I also don’t see why it would be in “AddFileToTar” at all)
e

eager-area-86739

09/18/2018, 6:17 PM
What do you mean by calling code? The lambda snippet?
s

stocky-spoon-28903

09/18/2018, 6:17 PM
Yes, sorry - the typescript (or whatever) that created the Archive that caused the panic
e

eager-area-86739

09/18/2018, 6:25 PM
Here we go:
Copy code
const lambda = new aws.lambda.Function("lambda", {
        description: Dummy API Endpoint",
        runtime: aws.lambda.DotnetCore2d1Runtime,
        code: new pulumi.asset.FileArchive("./artifacts/Lambda.zip"),
        timeout: 5,
        handler: "Lambda::Lambda.Function::Handler",
        role: role.arn,
        tags: {
            environment: stackConfig.require("environment")
        }
    });
s

stocky-spoon-28903

09/18/2018, 6:27 PM
Thanks
@eager-area-86739 If you could add the version of Pulumi that you’re using to that issue that would be great
e

eager-area-86739

09/19/2018, 7:16 AM
Sure thing!
Done
2 Views