def METHOD_NAME(self, image, resource_name):
    """
    Uploads given local image to ECR.
    :param image: locally tagged docker image that would be uploaded to ECR.
    :param resource_name: logical ID of the resource to be uploaded to ECR.
    :return: remote ECR image path that has been uploaded.
    """
    if not self.login_session_active:
        self.login()
        self.login_session_active = True
    try:
        docker_img = self.docker_client.images.get(image)
        _tag = tag_translation(image, docker_image_id=docker_img.id, gen_tag=self.tag)
        repository = (
            self.ecr_repo
            if not self.ecr_repo_multi or not isinstance(self.ecr_repo_multi, dict)
            else self.ecr_repo_multi.get(resource_name)
        )
        docker_img.tag(repository=repository, tag=_tag)
        push_logs = self.docker_client.api.push(
            repository=repository, tag=_tag, auth_config=self.auth_config, stream=True, decode=True
        )
        if not self.no_progressbar:
            self.log_streamer.stream_progress(push_logs)
        else:
            # we need to wait till the image got pushed to ecr, without this workaround sam sync for template
            # contains image always fail, because the provided ecr uri is not exist.
            _log_streamer = LogStreamer(stream=StreamWriter(stream=StringIO(), auto_flush=True))
            _log_streamer.stream_progress(push_logs)
    except (BuildError, APIError, LogStreamError) as ex:
        raise DockerPushFailedError(msg=str(ex)) from ex
    return f"{repository}:{_tag}"