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

refined-pilot-45584

02/26/2024, 10:06 AM
Hey All, Any one tried to mount a Cloud Storage Bucket to a Golang CloudRunv2 Service with Pulumi? I am getting a couple of strange errors here and I am not sure what is going on to be honest. So in my CloudRun Service I am Defining Volume as follows inside my Cloud Run service template:
Copy code
Volumes: &cloudrunv2.ServiceTemplateVolumeArray{
                                &cloudrunv2.ServiceTemplateVolumeArgs{
                                    Name: pulumi.String("bucket"),
                                    // Define the GCS bucket characteristics here.
                                    Gcs: &cloudrunv2.ServiceTemplateVolumeGcsArgs{        // LINE 424 - From STDERR
                                        Bucket:   gcsBucket.Name,
                                        ReadOnly: pulumi.Bool(false),
                                    },
                                },
                            },
When attempting to execute though I am getting the following two errors:
Copy code
./main.go:424:10: unknown field Gcs in struct literal of type cloudrunv2.ServiceTemplateVolumeArgs
    ./main.go:424:27: undefined: cloudrunv2.ServiceTemplateVolumeGcsArgs
I marked the lines in the code above with a comment for clarity. This is puzzling to me. The PKG says that field “Gcs” does exist in that struct definition. Additionally in the docs the ServiceTemplateVolumeGcsArgs type does exist. So I am a little baffled at what I might be missing here. Would appreciate any input and thoughts; I will also crosspost in Google-Cloud Channel
s

straight-beach-79533

02/27/2024, 7:06 PM
Hello, I am not familiar with GCP, but I did a quick search in the repo, https://github.com/pulumi/pulumi-gcp It seems that field
Gcs
has been added around one month ago. Git blame: https://github.com/pulumi/pulumi-gcp/blame/master/sdk/go/gcp/cloudrunv2/pulumiTypes.go#L7569 Following from there, we see the PR https://github.com/pulumi/pulumi-gcp/commit/1c61502d71adc9e38b59a6e6919e98785925a4c3 "Upgrading terraform-provider-google-beta from 5.12.0 to 5.13.0." If you search in that PR https://github.com/pulumi/pulumi-gcp/commit/1c61502d71adc9e38b59a6e6919e98785925a4c3#diff-5e2d525a692181eff239f4a84[…]66b729264b36f722ece2f1e02006d4 and finally
Copy code
+ // Represents a GCS Bucket mounted as a volume.
+ // Structure is documented below.
+ Gcs *ServiceTemplateVolumeGcs `pulumi:"gcs"`
r

refined-pilot-45584

02/27/2024, 9:17 PM
This is interesting. But I think everything I have is updated. So I’m not sure how to solve it