diff --git a/ecs_composex/ecs/ecs_family/__init__.py b/ecs_composex/ecs/ecs_family/__init__.py index 3962103e..2de21ba6 100644 --- a/ecs_composex/ecs/ecs_family/__init__.py +++ b/ecs_composex/ecs/ecs_family/__init__.py @@ -29,7 +29,7 @@ from ecs_composex.common.logging import LOG from ecs_composex.common.stacks import ComposeXStack -from ecs_composex.common.troposphere_tools import Parameter +from ecs_composex.common.troposphere_tools import Parameter, add_outputs, add_parameters from ecs_composex.compose.compose_services import ComposeService from ecs_composex.ecs import ecs_conditions, ecs_params from ecs_composex.ecs.ecs_family.family_helpers import ( @@ -41,12 +41,14 @@ from ecs_composex.ecs.managed_sidecars.aws_xray import set_xray from ecs_composex.ecs.service_compute import ServiceCompute from ecs_composex.ecs.service_networking import ServiceNetworking -from ecs_composex.ecs.service_networking.helpers import update_family_subnets +from ecs_composex.ecs.service_networking.helpers import ( + set_family_hostname, + update_family_subnets, +) from ecs_composex.ecs.service_scaling import ServiceScaling from ecs_composex.ecs.task_compute import TaskCompute from ecs_composex.ecs.task_iam import TaskIam -from ...common.troposphere_tools import add_outputs, add_parameters from .family_helpers import assign_secrets_to_roles, ensure_essential_containers from .family_template import set_template from .task_runtime import define_family_runtime_parameters @@ -105,6 +107,9 @@ def __init__(self, services: list[ComposeService], family_name): self.service_networking = None self.task_compute = None self.service_compute = ServiceCompute(self) + self.set_task_ephemeral_storage() + self.set_enable_execute_command() + set_family_hostname(self) @property def logical_name(self) -> str: @@ -355,9 +360,6 @@ def add_service(self, service: ComposeService): Function to add new services (defined in the compose files). Not to use for managed sidecars :param ComposeService service: """ - from ecs_composex.ecs.service_networking.helpers import set_family_hostname - - from .task_execute_command import set_enable_execute_command self._compose_services.append(service) @@ -371,7 +373,7 @@ def add_service(self, service: ComposeService): ) self.set_secrets_access() self.set_task_ephemeral_storage() - set_enable_execute_command(self) + self.set_enable_execute_command() set_family_hostname(self) def add_managed_sidecar(self, service: ComposeService):