From a94f56b22733294847cbe85dc399971ed9f16b8a Mon Sep 17 00:00:00 2001 From: Luke Hutchison Date: Sat, 25 May 2024 14:11:27 -0600 Subject: [PATCH 1/3] Support `redis_version` --- README.md | 1 + redis.tf | 2 ++ variables.tf | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index f5c2ff1..96755b6 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ No modules. | [database\_password](#input\_database\_password) | The password to use for the database. You can find the password in your 'config/passwords.yaml' file. | `string` | n/a | yes | | [database\_tier](#input\_database\_tier) | The tier of the database to use. Defaults to 'db-f1-micro'. | `string` | `"db-f1-micro"` | no | | [database\_version](#input\_database\_version) | The version of the database to use. Defaults to 'POSTGRES\_14'. Note that only PostgreSQL is supported. | `string` | `"POSTGRES_14"` | no | +| [redis\_version](#input\_redis\_version) | The version of Redis to use. Defaults to 'REDIS_7_2'. | `string` | `"REDIS_7_2"` | no | | [dns\_managed\_zone](#input\_dns\_managed\_zone) | The name of the DNS managed zone to use for the Serverpod infrastructure. If this is not set, a new managed zone will be created. | `string` | `""` | no | | [enable\_redis](#input\_enable\_redis) | Whether to enable Redis. Defaults to false. | `bool` | `false` | no | | [enable\_ssh](#input\_enable\_ssh) | Whether to enable SSH access to instances in the autoscaling group. Defaults to true. | `bool` | `true` | no | diff --git a/redis.tf b/redis.tf index f954a7f..59b7302 100644 --- a/redis.tf +++ b/redis.tf @@ -7,5 +7,7 @@ resource "google_redis_instance" "serverpod" { tier = var.redis_tier memory_size_gb = var.redis_memory_size_gb + redis_version = var.redis_version + authorized_network = google_compute_network.serverpod.id } \ No newline at end of file diff --git a/variables.tf b/variables.tf index db701c7..6dac1d1 100644 --- a/variables.tf +++ b/variables.tf @@ -66,6 +66,12 @@ variable "database_version" { default = "POSTGRES_14" } +variable "redis_version" { + description = "The version of Redis to use. Defaults to 'REDIS_7_2'." + type = string + default = "REDIS_7_2" +} + variable "database_tier" { description = "The tier of the database to use. Defaults to 'db-f1-micro'." type = string From a27f2395c8d00266beed5796d9ae9a7fcc329654 Mon Sep 17 00:00:00 2001 From: Luke Hutchison Date: Tue, 23 Jul 2024 23:57:20 -0600 Subject: [PATCH 2/3] Fix SSH ingress IP range --- firewall.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firewall.tf b/firewall.tf index c432ae8..3ccd0d4 100644 --- a/firewall.tf +++ b/firewall.tf @@ -20,7 +20,7 @@ resource "google_compute_firewall" "serverpod-instance-ssh" { name = "serverpod-${var.runmode}-instance-ssh" network = google_compute_network.serverpod.name - source_ranges = ["0.0.0.0/0"] + source_ranges = ["35.235.240.0/20"] allow { protocol = "tcp" From 0bd0a4bfa5b7ee65f202b174f3b3a32da022f26b Mon Sep 17 00:00:00 2001 From: Luke Hutchison Date: Wed, 24 Jul 2024 00:18:36 -0600 Subject: [PATCH 3/3] Add back 0.0.0.0/0 --- firewall.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firewall.tf b/firewall.tf index 3ccd0d4..78e0b0b 100644 --- a/firewall.tf +++ b/firewall.tf @@ -20,7 +20,7 @@ resource "google_compute_firewall" "serverpod-instance-ssh" { name = "serverpod-${var.runmode}-instance-ssh" network = google_compute_network.serverpod.name - source_ranges = ["35.235.240.0/20"] + source_ranges = ["0.0.0.0/0", "35.235.240.0/20"] allow { protocol = "tcp"