diff --git a/modules/cloud-run-v2/README.md b/modules/cloud-run-v2/README.md index 5289ff4f90..e714eb33f6 100644 --- a/modules/cloud-run-v2/README.md +++ b/modules/cloud-run-v2/README.md @@ -151,7 +151,7 @@ module "cloud_run" { } vpc_connector_create = { ip_cidr_range = "10.10.10.0/28" - vpc_self_link = var.vpc.self_link + network = var.vpc.self_link instances = { max = 10 min = 2 diff --git a/modules/cloud-run-v2/main.tf b/modules/cloud-run-v2/main.tf index 76164808f0..8ea430fc7e 100644 --- a/modules/cloud-run-v2/main.tf +++ b/modules/cloud-run-v2/main.tf @@ -52,7 +52,7 @@ resource "google_cloud_run_v2_service_iam_member" "default" { ) ? 1 : 0 project = google_cloud_run_v2_service.service[0].project location = google_cloud_run_v2_service.service[0].location - service = google_cloud_run_v2_service.service[0].name + name = google_cloud_run_v2_service.service[0].name role = "roles/run.invoker" member = "serviceAccount:${local.trigger_sa_email}" } diff --git a/modules/cloud-run-v2/service.tf b/modules/cloud-run-v2/service.tf index 7049b4a7d3..4517fbce1e 100644 --- a/modules/cloud-run-v2/service.tf +++ b/modules/cloud-run-v2/service.tf @@ -218,7 +218,7 @@ resource "google_cloud_run_v2_service_iam_binding" "binding" { for_each = var.create_job ? {} : var.iam project = google_cloud_run_v2_service.service[0].project location = google_cloud_run_v2_service.service[0].location - service = google_cloud_run_v2_service.service[0].name + name = google_cloud_run_v2_service.service[0].name role = each.key members = ( each.key != "roles/run.invoker" || !local.trigger_sa_create diff --git a/modules/cloud-run-v2/vpcconnector.tf b/modules/cloud-run-v2/vpcconnector.tf index dd55b1d6fe..50a7904c95 100644 --- a/modules/cloud-run-v2/vpcconnector.tf +++ b/modules/cloud-run-v2/vpcconnector.tf @@ -31,7 +31,7 @@ resource "google_vpc_access_connector" "connector" { min_instances = var.vpc_connector_create.instances.min min_throughput = var.vpc_connector_create.throughput.min dynamic "subnet" { - for_each = var.vpc_connector_create.subnet == null ? [] : [""] + for_each = var.vpc_connector_create.subnet.name == null ? [] : [""] content { name = var.vpc_connector_create.subnet.name project_id = var.vpc_connector_create.subnet.project_id diff --git a/tests/modules/cloud_run_v2/examples/service-eventarc-auditlogs-sa-create.yaml b/tests/modules/cloud_run_v2/examples/service-eventarc-auditlogs-sa-create.yaml index cbb26ce64f..bafabe8152 100644 --- a/tests/modules/cloud_run_v2/examples/service-eventarc-auditlogs-sa-create.yaml +++ b/tests/modules/cloud_run_v2/examples/service-eventarc-auditlogs-sa-create.yaml @@ -13,12 +13,12 @@ # limitations under the License. values: - module.cloud_run.google_cloud_run_service_iam_member.default[0]: + module.cloud_run.google_cloud_run_v2_service_iam_member.default[0]: condition: [] location: europe-west8 + name: hello project: project-id role: roles/run.invoker - service: hello module.cloud_run.google_cloud_run_v2_service.service[0]: location: europe-west8 name: hello @@ -64,7 +64,7 @@ values: project: project-id counts: - google_cloud_run_service_iam_member: 1 + google_cloud_run_v2_service_iam_member: 1 google_cloud_run_v2_service: 1 google_eventarc_trigger: 1 google_service_account: 1 diff --git a/tests/modules/cloud_run_v2/examples/service-eventarc-pubsub-sa-create.yaml b/tests/modules/cloud_run_v2/examples/service-eventarc-pubsub-sa-create.yaml index 1e9452e436..595d01aaf2 100644 --- a/tests/modules/cloud_run_v2/examples/service-eventarc-pubsub-sa-create.yaml +++ b/tests/modules/cloud_run_v2/examples/service-eventarc-pubsub-sa-create.yaml @@ -13,12 +13,12 @@ # limitations under the License. values: - module.cloud_run.google_cloud_run_service_iam_member.default[0]: + module.cloud_run.google_cloud_run_v2_service_iam_member.default[0]: condition: [] location: europe-west8 + name: hello project: project-id role: roles/run.invoker - service: hello module.cloud_run.google_cloud_run_v2_service.service[0]: location: europe-west8 name: hello @@ -61,7 +61,7 @@ values: timeouts: null counts: - google_cloud_run_service_iam_member: 1 + google_cloud_run_v2_service_iam_member: 1 google_cloud_run_v2_service: 1 google_eventarc_trigger: 1 google_service_account: 1 diff --git a/tests/modules/cloud_run_v2/examples/service-iam-env.yaml b/tests/modules/cloud_run_v2/examples/service-iam-env.yaml index 8a3e944526..6feb47a663 100644 --- a/tests/modules/cloud_run_v2/examples/service-iam-env.yaml +++ b/tests/modules/cloud_run_v2/examples/service-iam-env.yaml @@ -13,14 +13,14 @@ # limitations under the License. values: - module.cloud_run.google_cloud_run_service_iam_binding.binding["roles/run.invoker"]: + module.cloud_run.google_cloud_run_v2_service_iam_binding.binding["roles/run.invoker"]: condition: [] location: europe-west8 + name: hello members: - allUsers project: project-id role: roles/run.invoker - service: hello module.cloud_run.google_cloud_run_v2_service.service[0]: location: europe-west8 name: hello @@ -51,7 +51,7 @@ values: vpc_access: [] counts: - google_cloud_run_service_iam_binding: 1 + google_cloud_run_v2_service_iam_binding: 1 google_cloud_run_v2_service: 1 modules: 2 resources: 5