File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ resource "aws_iam_role" "ecs_task_role" {
7171resource "aws_cloudwatch_log_group" "app" {
7272 count = var. enabled ? 1 : 0
7373 name = " /ecs/${ local . name_prefix } "
74- retention_in_days = 7
74+ retention_in_days = 1 # Reduced from 7 days for cost optimization
7575
7676 tags = merge (local. common_tags , {
7777 Name = " ${ local . name_prefix } -logs"
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ resource "aws_cloudwatch_metric_alarm" "high_memory_utilization" {
2222 evaluation_periods = " 2"
2323 metric_name = " MemoryUtilization"
2424 namespace = " AWS/ECS"
25- period = " 300"
25+ period = " 300" # 5 minutes for cost optimization
2626 statistic = " Average"
2727 threshold = " 80"
2828 alarm_description = " This metric monitors ECS memory utilization - WILL FIRE when containers run out of memory"
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ variable "java_heap_size_mb" {
8282variable "enable_container_insights" {
8383 description = " Enable CloudWatch Container Insights for the ECS cluster"
8484 type = bool
85- default = true
85+ default = false # Disabled for cost optimization
8686}
8787
8888variable "health_check_grace_period" {
@@ -106,7 +106,7 @@ variable "application_port" {
106106variable "cpu_units" {
107107 description = " CPU units for ECS task (1024 = 1 vCPU)"
108108 type = number
109- default = 1024
109+ default = 512 # Reduced from 1024 for cost savings
110110}
111111
112112# Tags
Original file line number Diff line number Diff line change @@ -9,19 +9,19 @@ variable "example_env" {
99variable "enable_memory_optimization_demo" {
1010 description = " Enable the memory optimization demo scenario"
1111 type = bool
12- default = false
12+ default = true # Enable demo infrastructure
1313}
1414
1515variable "memory_optimization_container_memory" {
1616 description = " Memory allocation for containers in the demo (2048 = safe, 1024 = breaks)"
1717 type = number
18- default = 2048
18+ default = 1024 # Reduced from 2048MB to save costs
1919}
2020
2121variable "memory_optimization_container_count" {
2222 description = " Number of containers to run in the memory optimization demo"
2323 type = number
24- default = 15
24+ default = 3 # Reduced from 15 to 3 for cost optimization
2525}
2626
2727variable "days_until_black_friday" {
You can’t perform that action at this time.
0 commit comments