https://pulumi.com logo
Title
s

sticky-bear-14421

02/24/2023, 6:31 AM
Hi, a more general question, how would you deploy for example a Lambda function from your stack if the function code is written in Go aswell? For functions written in Python or JS/TS with NodeJS as Runtime, it is easy, just grab the Code via a FileArchive. But how do you compile a binary from the source code before stuffing the output into the archive? In AWS I could make use of a Codebuild job that would first compile the binary before starting the Pulumi infrastructure code. But from my stack or is this approach too far-fetched?
Hmm, just found the pulumi-command provider, that could be an option.
I’ll give it a try, even though it is marked as preview.
But I am open for further suggestions 🙂
b

bumpy-ice-21024

02/27/2023, 3:18 AM
Yeah we have a build process that zips the artifact (lambda go binary) and puts it in artifactory. Our infra build then pulls it down right before an infra deployment and reference that zip as part of an infra release.
So in your case use code build to publish an artifact to s3. Then point your infra to the new release
s

sticky-bear-14421

03/06/2023, 9:05 AM
@bumpy-ice-21024 Ok, so you do compile the lambdas in a different step before issuing the pulumi up. I guess that may be a better solution that with the command-provider to do the go compile lambdas/cmd/…
b

bumpy-ice-21024

03/07/2023, 2:26 AM
Yes always. That way I can run all my tests separately keeping my app code separate from my infra
If my tests or compilation fails then it never makes it to my infra
f

fierce-ability-58936

04/03/2023, 8:21 PM
You can use https://pkg.go.dev/embed Sorry for late answer!