Open jlenuffgsoi opened 6 months ago
Sorry that you're running into this issue and thanks for filing the ticket. I can reproduce the error when template.containers.env.value_source. secret_key_ref.version
is not explicitly specified in google_cloud_run_v2_service
resource. It doesn't look like version
is a required field based on the API doc. Do you start to see this error recently? If so, I wonder if anything has changed backend.
I can confirm this issue and forward this to the service team
I'm sorry, I recently use the google_cloud_run_v2_service
resource. So I can't tell from when this error shows up.
I'm also running into this issue. If secret_key_ref.version
is unset, the api just throws out BadRequest:
│ Error: Error updating Service "REDACTED-SERVICE": googleapi: Error 400: Violation in UpdateServiceRequest.service.template.containers[0].env[10].value_source.secret_key_ref.version: should have only alphanumeric characters, hyphens, and underscores, or positive integers
│ Details:
│ [
│ {
│ "@type": "type.googleapis.com/google.rpc.BadRequest",
│ "fieldViolations": [
│ {
│ "description": "should have only alphanumeric characters, hyphens, and underscores, or positive integers",
│ "field": "Violation in UpdateServiceRequest.service.template.containers[0].env[10].value_source.secret_key_ref.version"
│ }
│ ]
│ }
│ ]
Currently, I'm resolving this by coalescing the value and "latest" to make sure the version field is correct, but it does appear that it is incorrectly marked as optional.
Community Note
Terraform Version
Affected Resource(s)
google_cloud_run_v2_service
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service
Terraform Configuration
Debug Output
No response
Expected Behavior
Executing the code should not generate any errors.
Actual Behavior
Code execution throws this error :
Steps to reproduce
terraform apply
Important Factoids
When we not provide secret version, the
latest
version should be used.References
The official documentation states this :
b/332942986