Skip to content

Commit bcf97e5

Browse files
nikharsq2w
authored andcommitted
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 f94c05e commit bcf97e5

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
@@ -102,9 +102,18 @@ resource "google_cloud_run_v2_job" "job" {
102102
content {
103103
connector = vpc_access.value["connector"]
104104
egress = vpc_access.value["egress"]
105+
dynamic "network_interfaces" {
106+
for_each = vpc_access.value["network_interfaces"]
107+
content {
108+
network = network_interfaces.value["network"]
109+
subnetwork = network_interfaces.value["subnetwork"]
110+
tags = network_interfaces.value["tags"]
111+
}
112+
}
105113
}
106114
}
107115
}
116+
}
108117
}
109118
}
110119

modules/job-exec/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ variable "vpc_access" {
140140
type = list(object({
141141
connector = string
142142
egress = string
143+
network_interfaces = optional(object({
144+
network = optional(string)
145+
subnetwork = optional(string)
146+
tags = optional(list(string))
147+
}))
143148
}))
144149
description = "VPC Access configuration to use for this Task."
145150
default = []

0 commit comments

Comments
 (0)