Skip to content
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
2 changes: 1 addition & 1 deletion modules/scenarios/asg_change.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "aws_autoscaling_group" "my_asg" {
name = "asg-change-test-asg-${var.example_env}"
min_size = 0
max_size = 2
desired_capacity = 1
desired_capacity = 1 # Maintain single instance for cost optimization
target_group_arns = [aws_lb_target_group.my_target_group.arn]
vpc_zone_identifier = module.vpc.public_subnets
health_check_type = "EC2"
Expand Down
2 changes: 1 addition & 1 deletion modules/scenarios/memory-optimization/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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 = 1 # Reduced from 7 days for cost optimization
retention_in_days = 3 # Increased from 1 day for better debugging # 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 @@ -18,7 +18,7 @@ resource "aws_cloudwatch_metric_alarm" "high_memory_utilization" {
count = var.enabled ? 1 : 0
alarm_name = "${local.name_prefix}-high-memory"
comparison_operator = "GreaterThanThreshold"
evaluation_periods = "2"
evaluation_periods = "3" # Changed from "2"
metric_name = "MemoryUtilization"
namespace = "AWS/ECS"
period = "300" # 5 minutes for cost optimization
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,13 +82,13 @@ variable "java_heap_size_mb" {
variable "enable_container_insights" {
description = "Enable CloudWatch Container Insights for the ECS cluster"
type = bool
default = false # Disabled for cost optimization
default = true # Enabled for better monitoring
}

variable "health_check_grace_period" {
description = "Health check grace period in seconds (JVM needs time to start)"
type = number
default = 120
default = 180 # Changed from 120
}

variable "deregistration_delay" {
Expand Down