Skip to content

feat: allow upgrading rds major versions #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions modules/aws_ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ resource "aws_db_instance" "this" {
storage_throughput = var.rds_storage_throughput
iops = var.rds_iops
multi_az = var.rds_multi_az
allow_major_version_upgrade = var.allow_rds_major_version_upgrade

skip_final_snapshot = true
apply_immediately = true
Expand Down Expand Up @@ -454,12 +455,12 @@ resource "aws_ecs_task_definition" "retool_code_executor" {
local.common_containers,
[
{
name = "retool-code-executor"
essential = true
image = local.ecs_code_executor_image
cpu = var.launch_type == "EC2" ? var.ecs_task_resource_map["code_executor"]["cpu"] : null
memory = var.launch_type == "EC2" ? var.ecs_task_resource_map["code_executor"]["memory"] : null
user = var.launch_type == "EC2" ? null : "1001:1001"
name = "retool-code-executor"
essential = true
image = local.ecs_code_executor_image
cpu = var.launch_type == "EC2" ? var.ecs_task_resource_map["code_executor"]["cpu"] : null
memory = var.launch_type == "EC2" ? var.ecs_task_resource_map["code_executor"]["memory"] : null
user = var.launch_type == "EC2" ? null : "1001:1001"
# required to use nsjail sandboxing, which is required for custom libraries for JS and Python
# Learn more here: https://docs.retool.com/self-hosted/concepts/architecture#code-executor
# If not using nsjail sandboxing, update this to be false and use user = "1001:1001"
Expand All @@ -486,7 +487,7 @@ resource "aws_ecs_task_definition" "retool_code_executor" {
local.base_environment_variables,
[
{
name = "NODE_OPTIONS",
name = "NODE_OPTIONS",
value = "--max_old_space_size=1024"
}
],
Expand Down Expand Up @@ -635,7 +636,7 @@ resource "aws_service_discovery_service" "retool_code_executor_service" {

resource "aws_service_discovery_service" "retool_telemetry_service" {
count = var.telemetry_enabled ? 1 : 0
name = "telemetry"
name = "telemetry"

dns_config {
namespace_id = aws_service_discovery_private_dns_namespace.retool_namespace[0].id
Expand Down Expand Up @@ -701,4 +702,5 @@ module "temporal" {
aws_ecs_capacity_provider_name = var.launch_type == "EC2" ? aws_ecs_capacity_provider.this[0].name : null
task_propagate_tags = var.task_propagate_tags
service_discovery_namespace = local.service_discovery_namespace
allow_rds_major_version_upgrade = var.allow_rds_major_version_upgrade
}
11 changes: 6 additions & 5 deletions modules/aws_ecs/temporal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ module "temporal_aurora_rds" {
source = "terraform-aws-modules/rds-aurora/aws"
version = "8.5.0"

name = "${var.deployment_name}-temporal-rds-instance"
engine = "aurora-postgresql"
engine_mode = "provisioned"
engine_version = var.temporal_aurora_engine_version
storage_encrypted = true
name = "${var.deployment_name}-temporal-rds-instance"
engine = "aurora-postgresql"
engine_mode = "provisioned"
engine_version = var.temporal_aurora_engine_version
allow_major_version_upgrade = var.allow_rds_major_version_upgrade
storage_encrypted = true

vpc_id = var.vpc_id

Expand Down
6 changes: 6 additions & 0 deletions modules/aws_ecs/temporal/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,9 @@ variable "service_discovery_namespace" {
type = string
description = "Service discovery namespace DNS name for Retool ECS cluster."
}

variable "allow_rds_major_version_upgrade" {
type = bool
default = false
description = "Whether to allow major version upgrades for RDS. Defaults to false, set to true when upgrading Retool."
}
6 changes: 6 additions & 0 deletions modules/aws_ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -596,3 +596,9 @@ variable "alb_egress_rules" {
]
description = "Egress rules for load balancer"
}

variable "allow_rds_major_version_upgrade" {
type = bool
default = false
description = "Whether to allow major version upgrades for RDS. Defaults to false, set to true when upgrading Retool."
}