Skip to content

Commit ee80170

Browse files
committed
feat(cloudrun-job): Allow defining network interfaces
The terraform resource allows defining network interfaces but the module does not. Allow this capability to specify the network and subnetwork directly.
1 parent ea6e5f1 commit ee80170

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

modules/job-exec/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,18 @@ resource "google_cloud_run_v2_job" "job" {
9090
content {
9191
connector = vpc_access.value["connector"]
9292
egress = vpc_access.value["egress"]
93+
dynamic "network_interfaces" {
94+
for_each = vpc_access.value["network_interfaces"]
95+
content {
96+
network = network_interfaces.value["network"]
97+
subnetwork = network_interfaces.value["subnetwork"]
98+
tags = network_interfaces.value["tags"]
99+
}
100+
}
93101
}
94102
}
95103
}
104+
}
96105
}
97106
}
98107

modules/job-exec/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ variable "vpc_access" {
135135
type = list(object({
136136
connector = string
137137
egress = string
138+
network_interfaces = optional(object({
139+
network = optional(string)
140+
subnetwork = optional(string)
141+
tags = optional(list(string))
142+
}))
138143
}))
139144
description = "VPC Access configuration to use for this Task."
140145
default = []

0 commit comments

Comments
 (0)