34 lines
1.1 KiB
Terraform
34 lines
1.1 KiB
Terraform
![]() |
###############################################################################
|
||
|
# ECS service front
|
||
|
################################################################################
|
||
|
resource "aws_ecs_service" "frontend" {
|
||
|
name = "${local.name_prefix}-frontend"
|
||
|
cluster = data.aws_ssm_parameter.ecs_cluster_id.value
|
||
|
task_definition = aws_ecs_task_definition.frontend.arn
|
||
|
desired_count = var.num_workers
|
||
|
platform_version = "LATEST" # "1.4.0"
|
||
|
network_configuration {
|
||
|
subnets = data.aws_subnets.frontend_subnets.ids
|
||
|
# subnets = data.aws_subnets.backend_subnets.ids
|
||
|
security_groups = data.aws_security_groups.allin.ids
|
||
|
}
|
||
|
capacity_provider_strategy {
|
||
|
base = 1
|
||
|
capacity_provider = "FARGATE"
|
||
|
weight = 100
|
||
|
}
|
||
|
deployment_circuit_breaker {
|
||
|
enable = true
|
||
|
rollback = true
|
||
|
}
|
||
|
deployment_controller {
|
||
|
type = "ECS"
|
||
|
}
|
||
|
|
||
|
load_balancer {
|
||
|
target_group_arn = data.aws_ssm_parameter.target_group_arn.value
|
||
|
container_name = "${local.name_prefix}-frontend"
|
||
|
container_port = 8080
|
||
|
}
|
||
|
tags = merge(local.required_tags, var.tags)
|
||
|
}
|