Hi, I am trying to use the something similar to <h...
# golang
Hi, I am trying to use the something similar to https://github.com/pulumi/examples/tree/master/gcp-go-functions to deploy a
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
deploy is working
Copy code
gcloud functions deploy \
--runtime=go113 \
--trigger-http \
--allow-unauthenticated \
--region=us-east1 \
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?
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
My entrypoint was incorrect that was the issue. Thanks.
How do I make the function public?
Looks like you might need an Endpoint to enable this: https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-functions
Is there an example?
@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