Optimize default resource sizing for cost efficiency
- RDS: reduce replicas 2→1, monitoring_interval 10s→60s - Redis: cluster_size 3→2, instance_type cache.m5.large→cache.t4g.small - ECS: Fargate 50/50 FARGATE/SPOT split, disable Container Insights - ECS log retention: 90→30 days - Add dev.tfvars.example for aggressive dev/staging savings
This commit is contained in:
1 parent
c09d3aa68c
commit
bd235f0ee6
4 files changed
+112
-34
No files matched your search
+17
-17
@@ -202,7 +202,7 @@ variable "rds_config" {
|
||||
allowed_security_groups = optional(list(string), [])
|
||||
allowed_cidr_blocks = optional(list(string), [])
|
||||
apply_immediately = optional(bool, true)
|
||||
monitoring_interval = optional(number, 10)
|
||||
monitoring_interval = optional(number, 60)
|
||||
backtrack_window = optional(number, null)
|
||||
db_parameter_group_name = optional(string)
|
||||
db_parameters = optional(map(string), {})
|
||||
@@ -288,7 +288,7 @@ variable "rds_config" {
|
||||
cluster_tags = optional(map(string), {})
|
||||
skip_final_snapshot = optional(bool, true)
|
||||
backup_retention_period = optional(number, 7)
|
||||
replicas = optional(number, 2)
|
||||
replicas = optional(number, 1)
|
||||
serverless = optional(bool, false)
|
||||
serverless_min_capacity = optional(number, 2)
|
||||
serverless_max_capacity = optional(number, 10)
|
||||
@@ -302,7 +302,7 @@ variable "rds_config" {
|
||||
allowed_security_groups = []
|
||||
allowed_cidr_blocks = []
|
||||
apply_immediately = true
|
||||
monitoring_interval = 10
|
||||
monitoring_interval = 60
|
||||
backtrack_window = null
|
||||
db_parameter_group_name = null
|
||||
db_parameters = {}
|
||||
@@ -349,7 +349,7 @@ variable "rds_config" {
|
||||
cluster_tags = {}
|
||||
skip_final_snapshot = true
|
||||
backup_retention_period = 7
|
||||
replicas = 2
|
||||
replicas = 1
|
||||
serverless = false
|
||||
serverless_min_capacity = 2
|
||||
serverless_max_capacity = 10
|
||||
@@ -391,8 +391,8 @@ variable "redis_config" {
|
||||
allowed_security_group_ids = optional(list(string), [])
|
||||
subnets = optional(list(string))
|
||||
availability_zones = optional(list(string))
|
||||
cluster_size = optional(number, 3)
|
||||
instance_type = optional(string, "cache.m5.large")
|
||||
cluster_size = optional(number, 2)
|
||||
instance_type = optional(string, "cache.t4g.small")
|
||||
apply_immediately = optional(bool, true)
|
||||
automatic_failover_enabled = optional(bool, false)
|
||||
engine = optional(string, "redis")
|
||||
@@ -448,8 +448,8 @@ variable "redis_config" {
|
||||
allowed_security_group_ids = []
|
||||
subnets = null
|
||||
availability_zones = null
|
||||
cluster_size = 3
|
||||
instance_type = "cache.m5.large"
|
||||
cluster_size = 2
|
||||
instance_type = "cache.t4g.small"
|
||||
apply_immediately = true
|
||||
automatic_failover_enabled = false
|
||||
engine = "redis"
|
||||
@@ -493,7 +493,7 @@ variable "ecs_cluster" {
|
||||
cluster_name = optional(string, "fleet")
|
||||
cloudwatch_log_group = optional(object({
|
||||
create = optional(bool, true)
|
||||
retention_in_days = optional(number, 90)
|
||||
retention_in_days = optional(number, 30)
|
||||
kms = optional(object({
|
||||
cmk_enabled = optional(bool, null)
|
||||
enabled = optional(bool, null)
|
||||
@@ -509,7 +509,7 @@ variable "ecs_cluster" {
|
||||
})
|
||||
}), {
|
||||
create = true
|
||||
retention_in_days = 90
|
||||
retention_in_days = 30
|
||||
kms = {
|
||||
cmk_enabled = null
|
||||
enabled = null
|
||||
@@ -519,19 +519,19 @@ variable "ecs_cluster" {
|
||||
})
|
||||
cluster_settings = optional(any, {
|
||||
"name" : "containerInsights",
|
||||
"value" : "enabled",
|
||||
"value" : "disabled",
|
||||
})
|
||||
create = optional(bool, true)
|
||||
default_capacity_provider_use_fargate = optional(bool, true)
|
||||
fargate_capacity_providers = optional(any, {
|
||||
FARGATE = {
|
||||
default_capacity_provider_strategy = {
|
||||
weight = 100
|
||||
weight = 50
|
||||
}
|
||||
}
|
||||
FARGATE_SPOT = {
|
||||
default_capacity_provider_strategy = {
|
||||
weight = 0
|
||||
weight = 50
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -550,7 +550,7 @@ variable "ecs_cluster" {
|
||||
cluster_name = "fleet"
|
||||
cloudwatch_log_group = {
|
||||
create = true
|
||||
retention_in_days = 90
|
||||
retention_in_days = 30
|
||||
kms = {
|
||||
cmk_enabled = null
|
||||
enabled = null
|
||||
@@ -561,19 +561,19 @@ variable "ecs_cluster" {
|
||||
}
|
||||
cluster_settings = {
|
||||
"name" : "containerInsights",
|
||||
"value" : "enabled",
|
||||
"value" : "disabled",
|
||||
}
|
||||
create = true
|
||||
default_capacity_provider_use_fargate = true
|
||||
fargate_capacity_providers = {
|
||||
FARGATE = {
|
||||
default_capacity_provider_strategy = {
|
||||
weight = 100
|
||||
weight = 50
|
||||
}
|
||||
}
|
||||
FARGATE_SPOT = {
|
||||
default_capacity_provider_strategy = {
|
||||
weight = 0
|
||||
weight = 50
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user