https://pulumi.com logo
#golang
Title
b

billowy-nightfall-59212

04/13/2020, 8:55 PM
Hi, I am trying to use the something similar to https://github.com/pulumi/examples/tree/master/gcp-go-functions to deploy a
go
google cloud function
Copy code
.
├── deployments
│   ├── Pulumi.dev.yaml
│   ├── Pulumi.yaml
│   ├── go.mod
│   ├── go.sum
│   └── main.go
├── function
│   ├── Anagram.go
│   ├── Anagram_test.go
│   ├── go.mod
│   └── pkg
│       └── anagram
│           ├── anagram.go
│           └── anagram_test.go
└── scripts
    ├── Anagram_System_test.go
    └── systemtest.sh
I am running into this error.
Copy code
gcp:cloudfunctions:Function (Anagram):
    error: 1 error occurred:
    	* updating urn:pulumi:dev::magicleap::gcp:cloudfunctions/function:Function::Anagram: Error waiting for Updating CloudFunctions Function: Error code 3, message: Build failed: {"error":{"buildpackId":"google.go.build","buildpackVersion":"0.9.0","errorType":2,"canonicalCode":2,"errorId":"0eec69b1","errorMessage":"# serverless_function_app\n./main.go:24:43: undefined: function.Handler\n./main.go:26:44: undefined: function.Handler"},"stats":null}
Where as
gcloud
deploy is working
Copy code
gcloud functions deploy \
--runtime=go113 \
--trigger-http \
--allow-unauthenticated \
--region=us-east1 \
IsItAnagram
Deploying function (may take a while - up to 2 minutes)...done.
availableMemoryMb: 256
entryPoint: IsItAnagram
Any help as to how to troubleshoot would be appreciated?
l

lemon-agent-27707

04/13/2020, 10:18 PM
Can you share your code?
Specifically the main.go for your pulumi. The equivalent portion of this examples: https://github.com/pulumi/examples/blob/master/gcp-go-functions/main.go#L28-L35
b

billowy-nightfall-59212

04/13/2020, 11:57 PM
My entrypoint was incorrect that was the issue. Thanks.
How do I make the function public?
l

lemon-agent-27707

04/14/2020, 12:28 AM
Looks like you might need an Endpoint to enable this: https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-functions
b

billowy-nightfall-59212

04/14/2020, 12:39 AM
Is there an example?
t

tall-librarian-49374

04/14/2020, 5:34 AM
@billowy-nightfall-59212 you need to add a resource as in the issue that you quoted, just translate from TypeScript to Go
Endpoints are not needed
3 Views