Skip to content

Commit

Permalink
Update on service name and autoscaling(min_capacity,max_capacity, tar…
Browse files Browse the repository at this point in the history
…get_cpu_value) (#11)

Co-authored-by: Jazeel <[email protected]>
Co-authored-by: niroz89 <[email protected]>
  • Loading branch information
3 people authored Feb 7, 2023
1 parent c822517 commit 0144081
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module "service" {

source = "./modules/service"

name = format("%s-%s", var.name, replace(each.key, "_", "-"))
name = lookup(each.value, "name", format("%s-%s", var.name, replace(each.key, "_", "-")))
cluster_id = module.cluster.ecs_cluster_id
container_definitions = each.value.service_container_definitions
launch_type = var.launch_type
Expand Down Expand Up @@ -78,9 +78,9 @@ module "service_cpu_autoscaling_policy" {

name = format("%s-%s", var.name, replace(each.key, "_", "-"))
enable_ecs_cpu_based_autoscaling = true
min_capacity = var.service_min_capacity
max_capacity = var.service_max_capacity
target_cpu_value = var.service_target_cpu_value
min_capacity = lookup(each.value, "service_min_capacity", var.service_min_capacity)
max_capacity = lookup(each.value, "service_max_capacity", var.service_max_capacity)
target_cpu_value = lookup(each.value, "service_target_cpu_value", var.service_target_cpu_value)
ecs_cluster_name = module.cluster.ecs_cluster_name
ecs_service_name = module.service[each.key].ecs_service_name
}

0 comments on commit 0144081

Please sign in to comment.