Skip to content

Commit 74b6332

Browse files
authored
regional-go-service: configure request timeout (#129)
Signed-off-by: Jason Hall <[email protected]>
1 parent 589d6ab commit 74b6332

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

modules/regional-go-service/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ No requirements.
9595
| <a name="input_name"></a> [name](#input\_name) | n/a | `string` | n/a | yes |
9696
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
9797
| <a name="input_regions"></a> [regions](#input\_regions) | A map from region names to a network and subnetwork. A pub/sub topic and ingress service (publishing to the respective topic) will be created in each region, with the ingress service configured to egress all traffic via the specified subnetwork. | <pre>map(object({<br> network = string<br> subnet = string<br> }))</pre> | n/a | yes |
98+
| <a name="input_request_timeout_seconds"></a> [request\_timeout\_seconds](#input\_request\_timeout\_seconds) | The timeout for requests to the service, in seconds. | `number` | `300` | no |
9899
| <a name="input_scaling"></a> [scaling](#input\_scaling) | The scaling configuration for the service. | <pre>object({<br> min_instances = optional(number, 0)<br> max_instances = optional(number, 100)<br> max_instance_request_concurrency = optional(number)<br> })</pre> | `{}` | no |
99100
| <a name="input_service_account"></a> [service\_account](#input\_service\_account) | The service account as which to run the service. | `string` | n/a | yes |
100101
| <a name="input_volumes"></a> [volumes](#input\_volumes) | The volumes to make available to the containers in the service for mounting. | <pre>list(object({<br> name = string<br> empty_dir = optional(object({<br> medium = optional(string, "MEMORY")<br> }))<br> secret = optional(object({<br> secret = string<br> items = list(object({<br> version = string<br> path = string<br> }))<br> }))<br> }))</pre> | `[]` | no |

modules/regional-go-service/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ resource "google_cloud_run_v2_service" "this" {
5656
// for NAT egress, then we should incorporate those here.
5757
}
5858
service_account = var.service_account
59+
timeout = "${var.request_timeout_seconds}s"
5960
dynamic "containers" {
6061
for_each = var.containers
6162
content {

modules/regional-go-service/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,10 @@ variable "volumes" {
9898
}))
9999
default = []
100100
}
101+
102+
// https://cloud.google.com/run/docs/configuring/request-timeout
103+
variable "request_timeout_seconds" {
104+
description = "The timeout for requests to the service, in seconds."
105+
type = number
106+
default = 300
107+
}

0 commit comments

Comments
 (0)