up structure for tf

This commit is contained in:
LEMOINE Baptiste - EXT-SAVANE CONSULTING GROUP (SAFRAN AIRCRAFT ENGINES) 2025-09-19 10:09:31 +02:00
parent a3c818ef83
commit e31fdc2c02
874 changed files with 3019 additions and 67372 deletions

25
ecs_autoscaling.tf Normal file
View file

@ -0,0 +1,25 @@
# resource "aws_appautoscaling_target" "backend_autoscaling_target" {
# service_namespace = "ecs"
# resource_id = "service/${data.aws_ssm_parameter.ecs_cluster_id.value}/${aws_ecs_service.backend.name}"
# scalable_dimension = "ecs:service:DesiredCount"
# min_capacity = 1
# max_capacity = 3
# }
# resource "aws_appautoscaling_policy" "ecs_cpu_policy" {
# name = "ecs-cpu-scaling-policy"
# policy_type = "TargetTrackingScaling"
# resource_id = aws_appautoscaling_target.backend_autoscaling_target.resource_id
# scalable_dimension = aws_appautoscaling_target.backend_autoscaling_target.scalable_dimension
# service_namespace = aws_appautoscaling_target.backend_autoscaling_target.service_namespace
# target_tracking_scaling_policy_configuration {
# target_value = 90.0 # Scale when CPU exceeds 90%
# predefined_metric_specification {
# predefined_metric_type = "ECSServiceAverageCPUUtilization"
# }
# scale_in_cooldown = 300 # Wait 5 mins before scaling down
# scale_out_cooldown = 60 # Wait 1 min before scaling up
# }
# }