Skip to content

Commit 68c0174

Browse files
authored
fix: Update vpc_access description and add display metadata for vpc_access fields (#335)
1 parent 137fc53 commit 68c0174

File tree

5 files changed

+50
-19
lines changed

5 files changed

+50
-19
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ docker_test_lint:
3737
.PHONY: docker_generate_docs
3838
docker_generate_docs:
3939
docker run --rm -it \
40-
-e ENABLE_BPMETADATA \
40+
-e ENABLE_BPMETADATA=1 \
4141
-v $(CURDIR):/workspace \
4242
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
4343
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs'

modules/v2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Functional examples are included in the
6868
| timeout | Max allowed time for an instance to respond to a request. A duration in seconds with up to nine fractional digits, ending with 's' | `string` | `null` | no |
6969
| traffic | Specifies how to distribute traffic over a collection of Revisions belonging to the Service. If traffic is empty or not provided, defaults to 100% traffic to the latest Ready Revision. | <pre>list(object({<br> type = optional(string, "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST")<br> percent = optional(number, 100)<br> revision = optional(string, null)<br> tag = optional(string, null)<br> }))</pre> | `[]` | no |
7070
| volumes | Volumes needed for environment variables (when using secret) | <pre>list(object({<br> name = string<br> secret = optional(object({<br> secret = string<br> default_mode = optional(string)<br> items = optional(object({<br> path = string<br> version = optional(string)<br> mode = optional(string)<br> }))<br> }))<br> cloud_sql_instance = optional(object({<br> instances = optional(list(string))<br> }))<br> empty_dir = optional(object({<br> medium = optional(string)<br> size_limit = optional(string)<br> }))<br> gcs = optional(object({<br> bucket = string<br> read_only = optional(string)<br> }))<br> nfs = optional(object({<br> server = string<br> path = string<br> read_only = optional(string)<br> }))<br> }))</pre> | `[]` | no |
71-
| vpc\_access | VPC Access configuration to use for this Task, egress value should be either ALL\_TRAFFIC or PRIVATE\_RANGES\_ONLY. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc | <pre>object({<br> connector = optional(string)<br> egress = optional(string)<br> network_interfaces = optional(object({<br> network = optional(string)<br> subnetwork = optional(string)<br> tags = optional(list(string))<br> }))<br> })</pre> | `null` | no |
71+
| vpc\_access | Configure this to enable your service to send traffic to a Virtual Private Cloud. Set egress to ALL\_TRAFFIC or PRIVATE\_RANGES\_ONLY. Choose a connector or network\_interfaces (for direct VPC egress). For details: https://cloud.google.com/run/docs/configuring/connecting-vpc | <pre>object({<br> connector = optional(string)<br> egress = optional(string)<br> network_interfaces = optional(object({<br> network = optional(string)<br> subnetwork = optional(string)<br> tags = optional(list(string))<br> }))<br> })</pre> | `null` | no |
7272

7373
## Outputs
7474

modules/v2/metadata.display.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,37 @@ spec:
171171
name: vpc_access
172172
title: Vpc Access
173173
level: 1
174+
properties:
175+
egress:
176+
name: egress
177+
title: Egress
178+
subtext: Traffic VPC egress settings.
179+
enumValueLabels:
180+
- label: ALL_TRAFFIC
181+
value: ALL_TRAFFIC
182+
- label: PRIVATE_RANGES_ONLY
183+
value: PRIVATE_RANGES_ONLY
184+
connector:
185+
name: connector
186+
title: Connector
187+
subtext: VPC Access connector name.
188+
regexValidation: ^projects/(?:[a-z][a-z0-9-]*[a-z0-9]|[0-9]+)/locations/([a-z0-9-]+)/connectors/([a-z][a-z0-9-]*[a-z0-9])$
189+
validation: Invalid connector name. It must be in the format projects/{project}/locations/{location}/connectors/{connector}
190+
network_interfaces:
191+
name: network_interfaces
192+
title: Network Interfaces
193+
subtext: Direct VPC egress settings. Currently only single network interface is supported.
194+
toggleUsingVariables:
195+
- variableName: vpc_access.connector
196+
properties:
197+
network:
198+
name: network
199+
title: Network
200+
subtext: The VPC network that the Cloud Run resource will be able to send traffic to.
201+
subnetwork:
202+
name: subnetwork
203+
title: Subnetwork
204+
subtext: The VPC subnetwork that the Cloud Run resource will get IPs from. At least one of network or subnetwork must be specified. If both network and subnetwork are specified, the given VPC subnetwork must belong to the given VPC network. If subnetwork is not specified, the subnetwork with the same name with the network will be used.
174205
altDefaults:
175206
- type: ALTERNATE_TYPE_DC
176207
value:

modules/v2/metadata.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,16 @@ spec:
266266
version: ">= 0.1.0"
267267
spec:
268268
outputExpr: "[\"roles/bigtable.admin\"]"
269+
- name: ingress
270+
description: Provides the ingress settings for this Service. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.
271+
varType: string
272+
defaultValue: INGRESS_TRAFFIC_ALL
269273
- name: members
270274
description: "Users/SAs to be given invoker access to the service. Grant invoker access by specifying the users or service accounts (SAs). Use allUsers for public access, allAuthenticatedUsers for access by logged-in Google users, or provide a list of specific users/SAs. See the complete list of available options: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service_iam#member\\/members-1"
271275
varType: list(string)
272276
defaultValue: []
273277
- name: vpc_access
274-
description: VPC Access configuration to use for this Task, egress value should be either ALL_TRAFFIC or PRIVATE_RANGES_ONLY. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc
278+
description: "Configure this to enable your service to send traffic to a Virtual Private Cloud. Set egress to ALL_TRAFFIC or PRIVATE_RANGES_ONLY. Choose a connector or network_interfaces (for direct VPC egress). For details: https://cloud.google.com/run/docs/configuring/connecting-vpc"
275279
varType: |-
276280
object({
277281
connector = optional(string)
@@ -386,10 +390,6 @@ spec:
386390
version = optional(string, null)
387391
})
388392
defaultValue: {}
389-
- name: ingress
390-
description: Provides the ingress settings for this Service. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.
391-
varType: string
392-
defaultValue: INGRESS_TRAFFIC_ALL
393393
- name: launch_stage
394394
description: The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed.
395395
varType: string

modules/v2/variables.tf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ variable "service_account_project_roles" {
124124
default = []
125125
}
126126

127+
variable "ingress" {
128+
type = string
129+
description = "Provides the ingress settings for this Service. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active."
130+
default = "INGRESS_TRAFFIC_ALL"
131+
132+
validation {
133+
condition = contains(["INGRESS_TRAFFIC_ALL", "INGRESS_TRAFFIC_INTERNAL_ONLY", "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"], var.ingress)
134+
error_message = "Allowed values for ingress are \"INGRESS_TRAFFIC_ALL\", \"INGRESS_TRAFFIC_INTERNAL_ONLY\", or \"INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER\"."
135+
}
136+
}
137+
127138
variable "members" {
128139
type = list(string)
129140
description = "Users/SAs to be given invoker access to the service. Grant invoker access by specifying the users or service accounts (SAs). Use allUsers for public access, allAuthenticatedUsers for access by logged-in Google users, or provide a list of specific users/SAs. See the complete list of available options: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service_iam#member\\/members-1"
@@ -140,7 +151,7 @@ variable "vpc_access" {
140151
tags = optional(list(string))
141152
}))
142153
})
143-
description = "VPC Access configuration to use for this Task, egress value should be either ALL_TRAFFIC or PRIVATE_RANGES_ONLY. For more information, visit https://cloud.google.com/run/docs/configuring/connecting-vpc"
154+
description = "Configure this to enable your service to send traffic to a Virtual Private Cloud. Set egress to ALL_TRAFFIC or PRIVATE_RANGES_ONLY. Choose a connector or network_interfaces (for direct VPC egress). For details: https://cloud.google.com/run/docs/configuring/connecting-vpc"
144155
default = null
145156
}
146157

@@ -230,17 +241,6 @@ variable "client" {
230241
default = {}
231242
}
232243

233-
variable "ingress" {
234-
type = string
235-
description = "Provides the ingress settings for this Service. On output, returns the currently observed ingress settings, or INGRESS_TRAFFIC_UNSPECIFIED if no revision is active."
236-
default = "INGRESS_TRAFFIC_ALL"
237-
238-
validation {
239-
condition = contains(["INGRESS_TRAFFIC_ALL", "INGRESS_TRAFFIC_INTERNAL_ONLY", "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER"], var.ingress)
240-
error_message = "Allowed values for ingress are \"INGRESS_TRAFFIC_ALL\", \"INGRESS_TRAFFIC_INTERNAL_ONLY\", or \"INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER\"."
241-
}
242-
}
243-
244244
variable "launch_stage" {
245245
type = string
246246
description = "The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed."

0 commit comments

Comments
 (0)