Skip to content
Merged
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
2 changes: 1 addition & 1 deletion modules/scenarios/memory-optimization/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "aws_iam_role" "ecs_task_role" {
resource "aws_cloudwatch_log_group" "app" {
count = var.enabled ? 1 : 0
name = "/ecs/${local.name_prefix}"
retention_in_days = 7
retention_in_days = 1 # Reduced from 7 days for cost optimization

tags = merge(local.common_tags, {
Name = "${local.name_prefix}-logs"
Expand Down
2 changes: 1 addition & 1 deletion modules/scenarios/memory-optimization/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "aws_cloudwatch_metric_alarm" "high_memory_utilization" {
evaluation_periods = "2"
metric_name = "MemoryUtilization"
namespace = "AWS/ECS"
period = "300"
period = "300" # 5 minutes for cost optimization
statistic = "Average"
threshold = "80"
alarm_description = "This metric monitors ECS memory utilization - WILL FIRE when containers run out of memory"
Expand Down
4 changes: 2 additions & 2 deletions modules/scenarios/memory-optimization/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ variable "java_heap_size_mb" {
variable "enable_container_insights" {
description = "Enable CloudWatch Container Insights for the ECS cluster"
type = bool
default = true
default = false # Disabled for cost optimization
}

variable "health_check_grace_period" {
Expand All @@ -106,7 +106,7 @@ variable "application_port" {
variable "cpu_units" {
description = "CPU units for ECS task (1024 = 1 vCPU)"
type = number
default = 1024
default = 512 # Reduced from 1024 for cost savings
}

# Tags
Expand Down
6 changes: 3 additions & 3 deletions modules/scenarios/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ variable "example_env" {
variable "enable_memory_optimization_demo" {
description = "Enable the memory optimization demo scenario"
type = bool
default = false
default = true # Enable demo infrastructure
}

variable "memory_optimization_container_memory" {
description = "Memory allocation for containers in the demo (2048 = safe, 1024 = breaks)"
type = number
default = 2048
default = 1024 # Reduced from 2048MB to save costs
}

variable "memory_optimization_container_count" {
description = "Number of containers to run in the memory optimization demo"
type = number
default = 15
default = 3 # Reduced from 15 to 3 for cost optimization
}

variable "days_until_black_friday" {
Expand Down
Loading