https://pulumi.com logo
Title
d

dry-florist-5950

08/24/2021, 1:49 PM
Hi, does anyone have any examples of how to link an API to a function for google cloud? e.g. Create an endpoint and set the target function? I have done this in AWS using pulumi and was able to point each route to a lambda. Is the equivalent possible in GC? I cant see much in the docs or online about this. Thanks in advance.
w

witty-candle-66007

08/24/2021, 2:25 PM
Does this example do what you are looking for? https://github.com/pulumi/examples/tree/master/gcp-py-functions There are similar examples in that repo for other languages.
b

brash-quill-35776

08/24/2021, 2:29 PM
the example should work
d

dry-florist-5950

08/24/2021, 3:14 PM
Hmm not really what I meant but I also see what you mean. So I would like to be able to declare a function and then say this can only be accessed using a get request at this url. Kinda similar to this I guess - https://www.pulumi.com/docs/reference/pkg/gcp/cloudfunctions/function/
h

helpful-hair-30515

08/24/2021, 10:13 PM
I think you need to make use of google cloud endpoints(similar to API gateway in AWS) and with google cloud functions ...it will be possible to achieve it in Pulumi as i see they have APIs for both
d

dry-florist-5950

08/25/2021, 9:09 AM
Thank you!! I missed that for some reason, looks like what Im after