diff --git a/modules/v2/README.md b/modules/v2/README.md index 619282fa..90e82244 100644 --- a/modules/v2/README.md +++ b/modules/v2/README.md @@ -56,6 +56,7 @@ Functional examples are included in the | containers | Container images for the service |
list(object({
container_name = optional(string, null)
container_image = string
working_dir = optional(string, null)
depends_on_container = optional(list(string), null)
container_args = optional(list(string), null)
container_command = optional(list(string), null)
env_vars = optional(map(string), {})
env_secret_vars = optional(map(object({
secret = string
version = string
})), {})
volume_mounts = optional(list(object({
name = string
mount_path = string
})), [])
ports = optional(object({
name = optional(string, "http1")
container_port = optional(number, 8080)
}), {})
resources = optional(object({
limits = optional(object({
cpu = optional(string)
memory = optional(string)
nvidia_gpu = optional(string)
}))
cpu_idle = optional(bool, true)
startup_cpu_boost = optional(bool, false)
}), {})
startup_probe = optional(object({
failure_threshold = optional(number, null)
initial_delay_seconds = optional(number, null)
timeout_seconds = optional(number, null)
period_seconds = optional(number, null)
http_get = optional(object({
path = optional(string)
port = optional(string)
http_headers = optional(list(object({
name = string
value = string
})), [])
}), null)
tcp_socket = optional(object({
port = optional(number)
}), null)
grpc = optional(object({
port = optional(number)
service = optional(string)
}), null)
}), null)
liveness_probe = optional(object({
failure_threshold = optional(number, null)
initial_delay_seconds = optional(number, null)
timeout_seconds = optional(number, null)
period_seconds = optional(number, null)
http_get = optional(object({
path = optional(string)
port = optional(string)
http_headers = optional(list(object({
name = string
value = string
})), [])
}), null)
tcp_socket = optional(object({
port = optional(number)
}), null)
grpc = optional(object({
port = optional(number)
service = optional(string)
}), null)
}), null)
})) | n/a | yes |
| create\_service\_account | Create a new service account for cloud run service | `bool` | `true` | no |
| custom\_audiences | One or more custom audiences that you want this service to support. Specify each custom audience as the full URL in a string. [Refer](https://cloud.google.com/run/docs/configuring/custom-audiences) | `list(string)` | `null` | no |
+| default\_uri\_disabled | Whether the default Cloud Run service URI should be disabled. | `bool` | `false` | no |
| description | Cloud Run service description. This field currently has a 512-character limit. | `string` | `null` | no |
| enable\_prometheus\_sidecar | Enable Prometheus sidecar in Cloud Run instance. | `bool` | `false` | no |
| encryption\_key | A reference to a customer managed encryption key (CMEK) to use to encrypt this container image. This is optional. | `string` | `null` | no |
diff --git a/modules/v2/main.tf b/modules/v2/main.tf
index 83a27d5e..a625742f 100644
--- a/modules/v2/main.tf
+++ b/modules/v2/main.tf
@@ -340,12 +340,13 @@ resource "google_cloud_run_v2_service" "main" {
}
} // template
- annotations = var.service_annotations
- client = var.client.name
- client_version = var.client.version
- ingress = var.ingress
- launch_stage = var.launch_stage
- custom_audiences = var.custom_audiences
+ annotations = var.service_annotations
+ client = var.client.name
+ client_version = var.client.version
+ default_uri_disabled = var.default_uri_disabled
+ ingress = var.ingress
+ launch_stage = var.launch_stage
+ custom_audiences = var.custom_audiences
dynamic "binary_authorization" {
for_each = var.binary_authorization[*]
diff --git a/modules/v2/metadata.display.yaml b/modules/v2/metadata.display.yaml
index f183d4c5..9aaf6811 100644
--- a/modules/v2/metadata.display.yaml
+++ b/modules/v2/metadata.display.yaml
@@ -41,6 +41,10 @@ spec:
altDefaults:
- type: ALTERNATE_TYPE_DC
value: false
+ default_uri_disabled:
+ name: default_uri_disabled
+ title: Default URI Disabled
+ level: 1
containers:
name: containers
title: Containers
diff --git a/modules/v2/metadata.yaml b/modules/v2/metadata.yaml
index 408f64d7..257f886d 100644
--- a/modules/v2/metadata.yaml
+++ b/modules/v2/metadata.yaml
@@ -436,6 +436,10 @@ spec:
description: Restricts network access to your Cloud Run service
varType: string
defaultValue: INGRESS_TRAFFIC_ALL
+ - name: default_uri_disabled
+ description: Whether the default Cloud Run service URI should be disabled.
+ varType: bool
+ defaultValue: false
- name: members
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 here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service_iam#member\/members-1)
varType: list(string)
diff --git a/modules/v2/variables.tf b/modules/v2/variables.tf
index c62537e7..edad7d27 100644
--- a/modules/v2/variables.tf
+++ b/modules/v2/variables.tf
@@ -150,6 +150,12 @@ variable "ingress" {
}
}
+variable "default_uri_disabled" {
+ type = bool
+ description = "Whether the default Cloud Run service URI should be disabled."
+ default = false
+}
+
variable "members" {
type = list(string)
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 here](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service_iam#member\\/members-1)"
@@ -356,4 +362,3 @@ variable "execution_environment" {
error_message = "Allowed values for ingress are \"EXECUTION_ENVIRONMENT_GEN1\", \"EXECUTION_ENVIRONMENT_GEN2\"."
}
}
-