You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If an issue is assigned to a user, that user is claiming responsibility for the issue.
Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
When deploying a google_cloud_run_v2_service resource with a build configuration specified for a Cloud Run function, the service should build a container image from the provided source code and then deploy the function using this newly built image.
Actual Behavior
The google_cloud_run_v2_service resource, when deployed with a build configuration, does not build an image from the source code. Instead, it deploys the function with a default container image.
Steps to reproduce
Copy current configuration
Run terraform apply
Observe that the deployed Cloud Run service uses a default image rather than one built from the specified source.
Important Factoids
This behavior is unexpected because the google_cloudfunctions2_function resource correctly builds an image from source code by default before deploying.
The google_cloud_run_v2_service resource is being used specifically for its advanced networking capabilities (e.g., egress control, network interfaces without connectors) that are not available in the google_cloudfunctions2_function resource.
The issue seems to be a bug in how the google_cloud_run_v2_service handles build configurations.
References
Terraform Google Provider - google_cloud_run_v2_service documentation: https://registry.terraform.io/providers/hashicorp/google/6.37.0/docs/resources/cloud_run_v2_service#example-usage---cloudrunv2-service-function
Terraform Google Provider - cloudfunctions2_functiondocumentation: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function#example-usage---cloudfunctions2-private-workerpool
The text was updated successfully, but these errors were encountered:
Hey, the base image is public.
The issue is that I don’t want to use the image defined in the resource—I’d like to use the image that should build by the cloud run function. Currently to deploy the desired image I need to go the source code in the console and save and redeploy.
The expected behavior is the same as what happens in the cloudfunctions resource.
Which one are you looking to use, because it depends on the code specifications. The suggested is to use in both fields the same image as you can see in terraform registry examples (link here)
Uh oh!
There was an error while loading. Please reload this page.
Community Note
Terraform Version & Provider Version(s)
Terraform v2.7.1
on cloud build default
Affected Resource(s)
google_cloud_run_v2_service
Terraform Configuration
Debug Output
No response
Expected Behavior
When deploying a google_cloud_run_v2_service resource with a build configuration specified for a Cloud Run function, the service should build a container image from the provided source code and then deploy the function using this newly built image.
Actual Behavior
The google_cloud_run_v2_service resource, when deployed with a build configuration, does not build an image from the source code. Instead, it deploys the function with a default container image.
Steps to reproduce
terraform apply
Important Factoids
References
Terraform Google Provider - google_cloud_run_v2_service documentation: https://registry.terraform.io/providers/hashicorp/google/6.37.0/docs/resources/cloud_run_v2_service#example-usage---cloudrunv2-service-function
Terraform Google Provider - cloudfunctions2_functiondocumentation: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function#example-usage---cloudfunctions2-private-workerpool
The text was updated successfully, but these errors were encountered: