-
Notifications
You must be signed in to change notification settings - Fork 982
cloud-run-v2 is missing support for "network" attribute of (direct) vpc_access. #2691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Subnetwork name is not unique within the project, but it is unique within the region. You're deploying Cloud Run into specific region, so subnetwork is well defined. I'm reluctant to add
Providing subnetwork is far more straightforward and won't result in errors such as subnetwork doesn't exists, when you provide just the network. The UI flow is probably defined as such, to improve search for the subnetwork. The following example deploys without issue: module "cloud_run" {
source = "./fabric/modules/cloud-run-v2"
project_id = var.project_id
name = "hello"
region = var.region
launch_stage = "BETA"
containers = {
hello = {
image = "us-docker.pkg.dev/cloudrun/container/hello"
}
}
revision = {
gen2_execution_environment = true
max_instance_count = 20
vpc_access = {
egress = "ALL_TRAFFIC"
subnet = var.subnet.name
tags = ["tag1", "tag2", "tag3"]
}
}
deletion_protection = false
} |
I agree it "deploys without issue", it just looks invalid in the console (due to mandatory "network" field) |
@wiktorn if we add network as optional both use cases should be covered right? If no network is passed in we have the current behaviour (network is null), if users passes it in they get no warning in the console. WDYT? |
Yes, I was worried about the case when user provides Also - it also looked weird in console 😄 |
Awesome. Thanks guys :) |
Describe the bug
The module for cloud-run-v2 is missing support for "network" attribute of (direct) vpc_access.
The example in upstream module https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service#example-usage---cloudrunv2-service-directvpc includes this:
It should be optional. See structure at https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service#network_interfaces-1
It says "If network is not specified, it will be looked up from the subnetwork." but subnet names are not guaranteed to be project-unique, are they?
I tried using subnetwork=default (in VPC/network=default) and it ended up with an invalid-looking configuration in the console
Environment
To Reproduce
Sample config.
Expected behavior
Can specify "network" value
Result
No error, just strange situation per screenshot
Additional context
Add any other context about the problem here
The text was updated successfully, but these errors were encountered: