hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.32k stars 1.72k forks source link

google_endpoints_service only allows to specify 1 compiled .pb file #6517

Open svenschwermer opened 4 years ago

svenschwermer commented 4 years ago

Community Note

Description

google_endpoints_service only allows to specify one protoc compiled descriptor file (protoc_output_base64). Neither the underlying API nor the gcloud endpoints services deploy command have this limitation.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_endpoints_service" "grpc_service" {
  // ...
  protoc_output_base64 = [
    base64encode(file("compiled_descriptor_file_1.pb")),
    base64encode(file("compiled_descriptor_file_2.pb")),
  ]
  // ...
}

References

b/356678270

adambabik commented 3 years ago

I hit this issue today but there is an easy workaround - compile all your Protobufs into a single file descriptor (.pb file). I believe it might be a recommended approach actually as executing gcloud endpoints services deploy with one API config YAML file and multiple file descriptor was failing for me (the error was "Cannot resolve api 'my.api.MyService'" as if one file descriptor was overwriting the other). On the other hand, gcloud endpoints services deploy usage suggests it's possible to provide multiple file descriptors...

jos- commented 2 years ago

Related to this: it's impossible to set multiple grpc_config files, which is possible using gcloud and the underlying API.

Currently, the only workaround seems to be to use local-exec in combination with gcloud.

roaks3 commented 2 months ago

Assuming this is feasible since it is already an option in gcloud