Skip to content

Commit a356781

Browse files
committed
[fix] Set max/min intances in cloud-run-* modules using the correct variables.
1 parent 6c67515 commit a356781

File tree

15 files changed

+75
-47
lines changed

15 files changed

+75
-47
lines changed

cloud-run-rag-alloydb/1-apps/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ The [0-projects](../0-projects) stage generates the necessary Terraform input fi
3131

3232
| name | description | type | required | default |
3333
|---|---|:---:|:---:|:---:|
34-
| [project_config](variables.tf#L142) | The project where to create the resources. | <code title="object&#40;&#123;&#10; id &#61; string&#10; number &#61; string&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> || |
34+
| [project_config](variables.tf#L144) | The project where to create the resources. | <code title="object&#40;&#123;&#10; id &#61; string&#10; number &#61; string&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> || |
3535
| [alloydb_initial_password](variables.tf#L15) | Initial password for the postgres user in AlloyDB. | <code>string</code> | | <code>&#34;CHANGE_THIS&#33;&#33;&#33;&#34;</code> |
3636
| [ca_pool_name_suffix](variables.tf#L25) | The name suffix of the CA pool used for app ILB certificates. | <code>string</code> | | <code>&#34;ca-pool-0&#34;</code> |
37-
| [cloud_run_configs](variables.tf#L32) | The Cloud Run configurations. | <code title="object&#40;&#123;&#10; frontend &#61; object&#40;&#123;&#10; containers &#61; optional&#40;map&#40;any&#41;, &#123;&#10; frontend &#61; &#123;&#10; image &#61; &#34;us-docker.pkg.dev&#47;cloudrun&#47;container&#47;hello&#34;&#10; ports &#61; &#123;&#10; frontend &#61; &#123;&#10; container_port &#61; 8080&#10; &#125;&#10; &#125;&#10; &#125;&#10; &#125;&#41;&#10; ingress &#61; optional&#40;string, &#34;INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER&#34;&#41;&#10; max_instance_count &#61; optional&#40;number, 3&#41;&#10; service_invokers &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; vpc_access_egress &#61; optional&#40;string, &#34;ALL_TRAFFIC&#34;&#41;&#10; vpc_access_tags &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; &#125;&#41;&#10; ingestion &#61; object&#40;&#123;&#10; containers &#61; optional&#40;map&#40;any&#41;, &#123;&#10; ingestion &#61; &#123;&#10; image &#61; &#34;us-docker.pkg.dev&#47;cloudrun&#47;container&#47;hello&#34;&#10; &#125;&#10; &#125;&#41;&#10; ingress &#61; optional&#40;string, &#34;INGRESS_TRAFFIC_INTERNAL_ONLY&#34;&#41;&#10; max_instance_count &#61; optional&#40;number, 3&#41;&#10; service_invokers &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; vpc_access_egress &#61; optional&#40;string, &#34;ALL_TRAFFIC&#34;&#41;&#10; vpc_access_tags &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; &#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; frontend &#61; &#123;&#125;&#10; ingestion &#61; &#123;&#125;&#10;&#125;">&#123;&#8230;&#125;</code> |
38-
| [enable_deletion_protection](variables.tf#L72) | Whether deletion protection should be enabled. | <code>bool</code> | | <code>true</code> |
39-
| [ingestion_schedule_configs](variables.tf#L79) | The configuration of the Cloud Scheduler that calls invokes the Cloud Run ingestion job. | <code title="object&#40;&#123;&#10; attempt_deadline &#61; optional&#40;string, &#34;60s&#34;&#41;&#10; retry_count &#61; optional&#40;number, 3&#41;&#10; schedule &#61; optional&#40;string, &#34;&#42;&#47;30 &#42; &#42; &#42; &#42;&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
40-
| [lbs_config](variables.tf#L90) | The load balancers configuration. | <code title="object&#40;&#123;&#10; external &#61; optional&#40;object&#40;&#123;&#10; enable &#61; optional&#40;bool, true&#41;&#10; ip_address &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string, &#34;example.com&#34;&#41;&#10; allowed_ip_ranges &#61; optional&#40;list&#40;string&#41;, &#91;&#34;0.0.0.0&#47;0&#34;&#93;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; internal &#61; optional&#40;object&#40;&#123;&#10; enable &#61; optional&#40;bool, false&#41;&#10; ip_address &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string, &#34;example.com&#34;&#41;&#10; allowed_ip_ranges &#61; optional&#40;list&#40;string&#41;, &#91;&#34;0.0.0.0&#47;0&#34;&#93;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; external &#61; &#123;&#125;&#10; internal &#61; &#123;&#125;&#10;&#125;">&#123;&#8230;&#125;</code> |
41-
| [name](variables.tf#L117) | The name of the resources. This is also the project suffix if a new project is created. | <code>string</code> | | <code>&#34;gf-rrag-0&#34;</code> |
42-
| [networking_config](variables.tf#L124) | The networking configuration. | <code title="object&#40;&#123;&#10; create &#61; optional&#40;bool, true&#41;&#10; vpc_id &#61; optional&#40;string, &#34;net-0&#34;&#41;&#10; subnet &#61; optional&#40;object&#40;&#123;&#10; ip_cidr_range &#61; optional&#40;string, &#34;10.0.0.0&#47;24&#34;&#41;&#10; name &#61; optional&#40;string, &#34;sub-0&#34;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; subnet_proxy_only &#61; optional&#40;object&#40;&#123;&#10; ip_cidr_range &#61; optional&#40;string, &#34;10.20.0.0&#47;24&#34;&#41;&#10; name &#61; optional&#40;string, &#34;proxy-only-sub-0&#34;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
43-
| [region](variables.tf#L151) | The GCP region where to deploy the resources. | <code>string</code> | | <code>&#34;europe-west1&#34;</code> |
44-
| [service_accounts](variables.tf#L158) | The pre-created service accounts used by the blueprint. | <code title="map&#40;object&#40;&#123;&#10; email &#61; string&#10; iam_email &#61; string&#10; id &#61; string&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
37+
| [cloud_run_configs](variables.tf#L32) | The Cloud Run configurations. | <code title="object&#40;&#123;&#10; frontend &#61; object&#40;&#123;&#10; containers &#61; optional&#40;map&#40;any&#41;, &#123;&#10; frontend &#61; &#123;&#10; image &#61; &#34;us-docker.pkg.dev&#47;cloudrun&#47;container&#47;hello&#34;&#10; ports &#61; &#123;&#10; frontend &#61; &#123;&#10; container_port &#61; 8080&#10; &#125;&#10; &#125;&#10; &#125;&#10; &#125;&#41;&#10; ingress &#61; optional&#40;string, &#34;INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER&#34;&#41;&#10; max_instance_count &#61; optional&#40;number, 3&#41;&#10; min_instance_count &#61; optional&#40;number, 1&#41;&#10; service_invokers &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; vpc_access_egress &#61; optional&#40;string, &#34;ALL_TRAFFIC&#34;&#41;&#10; vpc_access_tags &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; &#125;&#41;&#10; ingestion &#61; object&#40;&#123;&#10; containers &#61; optional&#40;map&#40;any&#41;, &#123;&#10; ingestion &#61; &#123;&#10; image &#61; &#34;us-docker.pkg.dev&#47;cloudrun&#47;container&#47;hello&#34;&#10; &#125;&#10; &#125;&#41;&#10; ingress &#61; optional&#40;string, &#34;INGRESS_TRAFFIC_INTERNAL_ONLY&#34;&#41;&#10; max_instance_count &#61; optional&#40;number, 3&#41;&#10; min_instance_count &#61; optional&#40;number, 1&#41;&#10; service_invokers &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; vpc_access_egress &#61; optional&#40;string, &#34;ALL_TRAFFIC&#34;&#41;&#10; vpc_access_tags &#61; optional&#40;list&#40;string&#41;, &#91;&#93;&#41;&#10; &#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; frontend &#61; &#123;&#125;&#10; ingestion &#61; &#123;&#125;&#10;&#125;">&#123;&#8230;&#125;</code> |
38+
| [enable_deletion_protection](variables.tf#L74) | Whether deletion protection should be enabled. | <code>bool</code> | | <code>true</code> |
39+
| [ingestion_schedule_configs](variables.tf#L81) | The configuration of the Cloud Scheduler that calls invokes the Cloud Run ingestion job. | <code title="object&#40;&#123;&#10; attempt_deadline &#61; optional&#40;string, &#34;60s&#34;&#41;&#10; retry_count &#61; optional&#40;number, 3&#41;&#10; schedule &#61; optional&#40;string, &#34;&#42;&#47;30 &#42; &#42; &#42; &#42;&#34;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
40+
| [lbs_config](variables.tf#L92) | The load balancers configuration. | <code title="object&#40;&#123;&#10; external &#61; optional&#40;object&#40;&#123;&#10; enable &#61; optional&#40;bool, true&#41;&#10; ip_address &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string, &#34;example.com&#34;&#41;&#10; allowed_ip_ranges &#61; optional&#40;list&#40;string&#41;, &#91;&#34;0.0.0.0&#47;0&#34;&#93;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; internal &#61; optional&#40;object&#40;&#123;&#10; enable &#61; optional&#40;bool, false&#41;&#10; ip_address &#61; optional&#40;string&#41;&#10; domain &#61; optional&#40;string, &#34;example.com&#34;&#41;&#10; allowed_ip_ranges &#61; optional&#40;list&#40;string&#41;, &#91;&#34;0.0.0.0&#47;0&#34;&#93;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; external &#61; &#123;&#125;&#10; internal &#61; &#123;&#125;&#10;&#125;">&#123;&#8230;&#125;</code> |
41+
| [name](variables.tf#L119) | The name of the resources. This is also the project suffix if a new project is created. | <code>string</code> | | <code>&#34;gf-rrag-0&#34;</code> |
42+
| [networking_config](variables.tf#L126) | The networking configuration. | <code title="object&#40;&#123;&#10; create &#61; optional&#40;bool, true&#41;&#10; vpc_id &#61; optional&#40;string, &#34;net-0&#34;&#41;&#10; subnet &#61; optional&#40;object&#40;&#123;&#10; ip_cidr_range &#61; optional&#40;string, &#34;10.0.0.0&#47;24&#34;&#41;&#10; name &#61; optional&#40;string, &#34;sub-0&#34;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10; subnet_proxy_only &#61; optional&#40;object&#40;&#123;&#10; ip_cidr_range &#61; optional&#40;string, &#34;10.20.0.0&#47;24&#34;&#41;&#10; name &#61; optional&#40;string, &#34;proxy-only-sub-0&#34;&#41;&#10; &#125;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
43+
| [region](variables.tf#L153) | The GCP region where to deploy the resources. | <code>string</code> | | <code>&#34;europe-west1&#34;</code> |
44+
| [service_accounts](variables.tf#L160) | The pre-created service accounts used by the blueprint. | <code title="map&#40;object&#40;&#123;&#10; email &#61; string&#10; iam_email &#61; string&#10; id &#61; string&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
4545

4646
## Outputs
4747

cloud-run-rag-alloydb/1-apps/frontend.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ module "cloud_run_frontend" {
4949
service_config = {
5050
gen2_execution_environment = true
5151
ingress = var.cloud_run_configs.frontend.ingress
52-
max_instance_count = var.cloud_run_configs.frontend.max_instance_count
52+
scaling = {
53+
max_instance_count = var.cloud_run_configs.frontend.max_instance_count
54+
min_instance_count = var.cloud_run_configs.frontend.min_instance_count
55+
}
5356
}
5457
}

cloud-run-rag-alloydb/1-apps/ingestion.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ module "cloud_run_ingestion" {
5454
service_config = {
5555
gen2_execution_environment = true
5656
ingress = var.cloud_run_configs.ingestion.ingress
57-
max_instance_count = var.cloud_run_configs.ingestion.max_instance_count
57+
scaling = {
58+
max_instance_count = var.cloud_run_configs.ingestion.max_instance_count
59+
min_instance_count = var.cloud_run_configs.ingestion.min_instance_count
60+
}
5861
}
5962
}
6063

cloud-run-rag-alloydb/1-apps/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ variable "cloud_run_configs" {
4545
})
4646
ingress = optional(string, "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER")
4747
max_instance_count = optional(number, 3)
48+
min_instance_count = optional(number, 1)
4849
service_invokers = optional(list(string), [])
4950
vpc_access_egress = optional(string, "ALL_TRAFFIC")
5051
vpc_access_tags = optional(list(string), [])
@@ -57,6 +58,7 @@ variable "cloud_run_configs" {
5758
})
5859
ingress = optional(string, "INGRESS_TRAFFIC_INTERNAL_ONLY")
5960
max_instance_count = optional(number, 3)
61+
min_instance_count = optional(number, 1)
6062
service_invokers = optional(list(string), [])
6163
vpc_access_egress = optional(string, "ALL_TRAFFIC")
6264
vpc_access_tags = optional(list(string), [])

0 commit comments

Comments
 (0)