Hi, I'm trying different options with Pulumi, and ...
# general
e
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
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
Yeah, mine works like that. What I'm looking for is to point to a zip file, rather then a directory
w
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
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
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
thanks
@stocky-spoon-28903
s
Do you have the complete panic backtrace for the segfualt @eager-area-86739?
e
Yes I do.
s
Could you stick it in a gist? That’s something that likely wants fixing!
e
Here:
<https://gist.github.com/joaoasrosa/67b3ac4e3011f1efc68f14018a566487>
Cheers
s
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
What do you mean by calling code? The lambda snippet?
s
Yes, sorry - the typescript (or whatever) that created the Archive that caused the panic
e
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
Thanks
@eager-area-86739 If you could add the version of Pulumi that you’re using to that issue that would be great
e
Sure thing!
Done