diff --git a/modules/cloud-run/README.md b/modules/cloud-run/README.md
index 9096cd90..1d6b1478 100644
--- a/modules/cloud-run/README.md
+++ b/modules/cloud-run/README.md
@@ -136,11 +136,11 @@ module "cloud_run" {
| name | description | type | required | default |
|---|---|:---: |:---:|:---:|
-| containers | Containers | list(object({...}))
| ✓ | |
+| containers | Containers | list(object({...}))
| ✓ | |
| name | Name used for cloud run service | string
| ✓ | |
| project_id | Project id used for all resources. | string
| ✓ | |
| *audit_log_triggers* | Event arc triggers (Audit log) | list(object({...}))
| | null
|
-| *iam* | IAM bindings for topic in {ROLE => [MEMBERS]} format. | map(list(string))
| | {}
|
+| *iam* | IAM bindings for Cloud Run service in {ROLE => [MEMBERS]} format. | map(list(string))
| | {}
|
| *ingress_settings* | Ingress settings | string
| | null
|
| *labels* | Resource labels | map(string)
| | {}
|
| *prefix* | Optional prefix used for resource names. | string
| | null
|
diff --git a/modules/cloud-run/main.tf b/modules/cloud-run/main.tf
index 90738516..1fb010e2 100644
--- a/modules/cloud-run/main.tf
+++ b/modules/cloud-run/main.tf
@@ -96,10 +96,10 @@ resource "google_cloud_run_service" "service" {
}
}
dynamic "volume_mounts" {
- for_each = containers.value["volume_mounts"] == null ? [] : containers.value["volume_mounts"]
+ for_each = containers.value["volume_mounts"] == null ? {} : containers.value["volume_mounts"]
content {
- name = volume_mounts.value["name"]
- mount_path = volume_mounts.value["mount_path"]
+ name = volume_mounts.key
+ mount_path = volume_mounts.value
}
}
}
diff --git a/modules/cloud-run/variables.tf b/modules/cloud-run/variables.tf
index 1a5d80e8..fed8145f 100644
--- a/modules/cloud-run/variables.tf
+++ b/modules/cloud-run/variables.tf
@@ -50,10 +50,7 @@ variable "containers" {
protocol = string
container_port = string
}))
- volume_mounts = list(object({
- name = string
- mount_path = string
- }))
+ volume_mounts = map(string)
}))
}