Skip to content

Commit

Permalink
infra: upscale resources (#351)
Browse files Browse the repository at this point in the history
- upgrade ECS to min2/max8 instances
- upgrade DB to t4g.medium
  • Loading branch information
tudoramariei authored Dec 23, 2024
1 parent c5061c1 commit aa395ef
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion terraform/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "aws_db_instance" "main" {
skip_final_snapshot = var.env != "production"
final_snapshot_identifier = "${local.namespace}-final-snapshot"

maintenance_window = "Wed:00:00-Wed:01:00"
maintenance_window = "Wed:01:30-Wed:03:30"

performance_insights_enabled = true
performance_insights_retention_period = 7
Expand Down
4 changes: 2 additions & 2 deletions terraform/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module "ecs_cluster" {
default_instance_type = "t3a.small"
instance_types = local.ecs.instance_types

min_size = 1
max_size = 2
min_size = 2
max_size = 8
minimum_scaling_step_size = 1
maximum_scaling_step_size = 1

Expand Down
2 changes: 1 addition & 1 deletion terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ locals {

db = {
name = "redirectioneaza"
instance_class = "db.t4g.micro" # var.env == "production" ? "db.t4g.medium" : "db.t4g.micro"
instance_class = var.env == "production" ? "db.t4g.medium" : "db.t4g.micro"
}

networking = {
Expand Down
4 changes: 2 additions & 2 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module "ecs_redirectioneaza" {

name = local.namespace
cluster_name = module.ecs_cluster.cluster_name
min_capacity = 1
max_capacity = 2
min_capacity = 2
max_capacity = 8

image_repo = local.image_repo
image_tag = local.image_tag
Expand Down

0 comments on commit aa395ef

Please sign in to comment.