https://pulumi.com logo
c

clean-autumn-55516

04/20/2020, 2:09 AM
Hi! First off, loving Pulumi, coming from using Terraform and Serverless Framework, I absolutely love the approach. I seem to have run into a use case that I can't seem to find a solution for and have searched quite a bit. I am deploying a Cloud Function to GCP. My Cloud function has a dependency on Prisma Client. The main issue is that I need to run/add a post install script for my cloud function that generates the prisma client. I have tried adding the following to my main package.json file. This doesnt work because when I look at the source being generated for the Cloud function, the package.json is only a few dependency for the function itself and no scripts section.
Copy code
"scripts": {
    "postinstall": "npx prisma generate"
  }
Am I running into a limitation here? Is there a way to have pulumi deploy a function with a custom package.json to achieve a post install script?
t

tall-librarian-49374

04/20/2020, 12:47 PM
Are you using callback-based functions?
c

clean-autumn-55516

04/20/2020, 5:14 PM
@tall-librarian-49374 yes
t

tall-librarian-49374

04/20/2020, 6:08 PM
Could you open an issue in the pulumi-gcp repo? I think it’s not possible right now but I’d love to help.
c

clean-autumn-55516

04/20/2020, 6:57 PM
Made this last night, should I move the issue? https://github.com/pulumi/pulumi/issues/4451
t

tall-librarian-49374

04/20/2020, 7:57 PM
Missed it, moved now. Could you add a bit more details, like maybe just this slack message? A repro code would be awesome but you don’t have to.
👍 1