def METHOD_NAME(self, name: str, task_definition: str, container_name: str):
    region_name = get_aws_region_name()
    config = Config(region_name=region_name)
    ec2_client = boto3.client('ec2', config=config)
    # create new task
    def find_main_task(task):
        tags = task.get('tags')
        dev_tag = find(lambda tag: tag.get('key') == 'dev-instance', tags)
        return (dev_tag is None or dev_tag.get('value') != '1') \
            and task.get('lastStatus') == 'RUNNING'
    task = find(find_main_task, list_tasks(self.cluster_name))
    network_interface = self.__get_network_interfaces([task], ec2_client)[task['taskArn']]
    subnets = [network_interface['SubnetId']]
    security_groups = [g['GroupId'] for g in network_interface['Groups']]
    try:
        service = find(
            lambda service: service.get('status') == 'ACTIVE',
            list_services(self.cluster_name)
        )
        network_configuration = service.get('networkConfiguration')
    except Exception as err:
        print(f'Could not get network configuration with error: {str(err)}')
        network_configuration = None
    ecs_config = EcsConfig(
        task_definition,
        container_name,
        self.cluster_name,
        security_groups=security_groups,
        subnets=subnets,
        tags=[
            {
                'key': 'name',
                'value': name,
            },
            {
                'key': 'dev-instance',
                'value': '1',
            }
        ],
        network_configuration=network_configuration,
        cpu=int(task.get('cpu')),
        memory=int(task.get('memory')),
    )
    self.instance_metadata = {
        **self.instance_metadata,
        name: dict()
    }
    return run_task(f'mage start {name}', ecs_config=ecs_config, wait_for_completion=False)