diff --git a/services/terraform/remote/service_backup.tf b/services/terraform/remote/service_backup.tf --- a/services/terraform/remote/service_backup.tf +++ b/services/terraform/remote/service_backup.tf @@ -185,33 +185,13 @@ certificate_arn = data.aws_acm_certificate.backup_service.arn default_action { - type = "forward" - - # Weighted forwarding for both environments - forward { - target_group { - arn = aws_lb_target_group.backup_service_http.arn - weight = 0 # 0% EC2 - } - - target_group { - arn = aws_lb_target_group.backup_service_http_fargate.arn - weight = 100 # 100% Fargate - } - - stickiness { - enabled = false - duration = 10 - } - } + type = "forward" + target_group_arn = aws_lb_target_group.backup_service_http_fargate.arn } lifecycle { # Target group cannot be destroyed if it is used - replace_triggered_by = [aws_lb_target_group.backup_service_http] - - # Required to avoid no-op plan differences - ignore_changes = [default_action[0].forward[0].stickiness[0].duration] + replace_triggered_by = [aws_lb_target_group.backup_service_http_fargate] } } diff --git a/services/terraform/remote/service_blob.tf b/services/terraform/remote/service_blob.tf --- a/services/terraform/remote/service_blob.tf +++ b/services/terraform/remote/service_blob.tf @@ -188,33 +188,13 @@ certificate_arn = data.aws_acm_certificate.blob_service.arn default_action { - type = "forward" - - # Weighted forwarding for both environments - forward { - target_group { - arn = aws_lb_target_group.blob_service_http.arn - weight = 0 # 0% EC2 - } - - target_group { - arn = aws_lb_target_group.blob_service_http_fargate.arn - weight = 100 # 100% Fargate - } - - stickiness { - enabled = false - duration = 10 - } - } + type = "forward" + target_group_arn = aws_lb_target_group.blob_service_http_fargate.arn } lifecycle { - # Required only for existing resources to avoid plan difference - ignore_changes = [default_action[0].forward[0].stickiness[0].duration] - # Target group cannot be destroyed if it is used - replace_triggered_by = [aws_lb_target_group.blob_service_http] + replace_triggered_by = [aws_lb_target_group.blob_service_http_fargate] } } diff --git a/services/terraform/remote/service_identity.tf b/services/terraform/remote/service_identity.tf --- a/services/terraform/remote/service_identity.tf +++ b/services/terraform/remote/service_identity.tf @@ -280,30 +280,12 @@ certificate_arn = data.aws_acm_certificate.identity_service.arn default_action { - type = "forward" - - # Weighted forwarding for both environments - forward { - target_group { - arn = aws_lb_target_group.identity_service_ws.arn - weight = 0 # 0% EC2 - } - - target_group { - arn = aws_lb_target_group.identity_service_ws_fargate.arn - weight = 100 # 100% Fargate - } - - stickiness { - enabled = false - duration = 10 - } - } + type = "forward" + target_group_arn = aws_lb_target_group.identity_service_ws_fargate.arn } lifecycle { - ignore_changes = [default_action[0].forward[0].stickiness[0].duration] - replace_triggered_by = [aws_lb_target_group.identity_service_ws] + replace_triggered_by = [aws_lb_target_group.identity_service_ws_fargate] } } @@ -315,33 +297,13 @@ certificate_arn = data.aws_acm_certificate.identity_service.arn default_action { - type = "forward" - - # Weighted forwarding for both environments - forward { - target_group { - arn = aws_lb_target_group.identity_service_grpc.arn - weight = 0 # 0% EC2 - } - - target_group { - arn = aws_lb_target_group.identity_service_grpc_fargate.arn - weight = 100 # 100% Fargate - } - - stickiness { - enabled = true - duration = 10 - } - } + type = "forward" + target_group_arn = aws_lb_target_group.identity_service_grpc_fargate.arn } lifecycle { - # Required only for existing resources to avoid plan difference - ignore_changes = [default_action[0].forward[0].stickiness[0].duration] - # Target group cannot be destroyed if it is used - replace_triggered_by = [aws_lb_target_group.identity_service_grpc] + replace_triggered_by = [aws_lb_target_group.identity_service_grpc_fargate] } } diff --git a/services/terraform/remote/service_tunnelbroker.tf b/services/terraform/remote/service_tunnelbroker.tf --- a/services/terraform/remote/service_tunnelbroker.tf +++ b/services/terraform/remote/service_tunnelbroker.tf @@ -319,30 +319,12 @@ certificate_arn = data.aws_acm_certificate.tunnelbroker.arn default_action { - type = "forward" - - # Weighted forwarding for both environments - forward { - target_group { - arn = aws_lb_target_group.tunnelbroker_ws.arn - weight = 0 # 0% EC2 - } - - target_group { - arn = aws_lb_target_group.tunnelbroker_ws_fargate.arn - weight = 100 # 100% Fargate - } - - stickiness { - enabled = false - duration = 10 - } - } + type = "forward" + target_group_arn = aws_lb_target_group.tunnelbroker_ws_fargate.arn } lifecycle { - ignore_changes = [default_action[0].forward[0].stickiness[0].duration] - replace_triggered_by = [aws_lb_target_group.tunnelbroker_ws] + replace_triggered_by = [aws_lb_target_group.tunnelbroker_ws_fargate] } } @@ -355,28 +337,12 @@ certificate_arn = data.aws_acm_certificate.tunnelbroker.arn default_action { - type = "forward" - forward { - target_group { - arn = aws_lb_target_group.tunnelbroker_grpc.arn - weight = 0 # Switch to 0% EC2 - } - - target_group { - arn = aws_lb_target_group.tunnelbroker_grpc_fargate.arn - weight = 100 # Switch to 100% Fargate - } - - stickiness { - enabled = false - duration = 10 - } - } + type = "forward" + target_group_arn = aws_lb_target_group.tunnelbroker_grpc_fargate.arn } lifecycle { - ignore_changes = [default_action[0].forward[0].stickiness[0].duration] - replace_triggered_by = [aws_lb_target_group.tunnelbroker_grpc] + replace_triggered_by = [aws_lb_target_group.tunnelbroker_grpc_fargate] } }