Failed to connect to my Hub http://HOST_IP:8081 at Is it running?

I am running jupyterhub on an ec2 instance inside docker with the following jupyterhub_config.py

c = get_config()

c.Authenticator.admin_users = {'USER_NAME'}

c.JupyterHub.spawner_class = 'awsspawner.EcsTaskSpawner'

c.Spawner.cluster_name = 'staging-notebook-cluster'

c.Spawner.ecs_task_definition = 'jupyter-scipy-notebook'

c.Spawner.port = 8000

c.Spawner.http_timeout = 60 

#c.JupyterHub.hub_ip = '0.0.0.0'

#c.JupyterHub.hub_connect_ip = 'HOST_IP'

# shutdown the server after no activity for an hour

c.NotebookApp.shutdown_no_activity_timeout = 60 * 60

# shutdown kernels after no activity for 20 minutes

c.MappingKernelManager.cull_idle_timeout = 20 * 60

# check for idle kernels every two minutes

c.MappingKernelManager.cull_interval = 2 * 60

I am using custom spawner to spawn notebooks on ecs cluster. Hub is able to run task on ecs cluster but the task if failing with the following error

[E 2020-04-29 09:20:14.444 ayush.chauhan@zomato.com singleuser:438] Failed to connect to my Hub at http://HUB_HOST_IP:8081/jupyter/hub/api (attempt 5/5). Is it running?
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.7/site-packages/jupyterhub/singleuser.py", line 432, in check_hub_version
        resp = await client.fetch(self.hub_api_url)
    ConnectionRefusedError: [Errno 111] Connection refused

Following env variables are used in the task
“Env”: [
“LANG=en_US.UTF-8”,
“LC_ALL=en_US.UTF-8”,
“JPY_USER=USER_NAME”,
“JUPYTERHUB_ACTIVITY_URL=http://HUB_HOST_IP:8081/users/USER_NAME/activity”,
“JUPYTERHUB_API_TOKEN=TOKEN”,
“JUPYTERHUB_SERVICE_PREFIX=/user/USER_NAME/”,
“JPY_API_TOKEN=TOKEN”,
“JUPYTERHUB_BASE_URL=/user/USER_NAME/”,
“JUPYTERHUB_USER=USER_NAME”,
“JPY_COOKIE_NAME=cookie”,
“JUPYTERHUB_OAUTH_CALLBACK_URL=/user/USER_NAME/oauth_callback”,
“JUPYTERHUB_SERVER_NAME=”,
“JPY_BASE_URL=/user/USER_NAME/”,
“JUPYTERHUB_API_URL=http://HUB_HOST_IP:8081/jupyter/hub/api”,
“JUPYTERHUB_CLIENT_ID=jupyterhub-user-USER_NAME”,
“JUPYTERHUB_HOST=”,
“PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”
]

I have tried changing the JUPYTERHUB_ACTIVITY_URL and JUPYTERHUB_API_URL port to 8000 too still it is failing. I changed that because telnet is working for 8000 port only from the ecs cluster instance

My hub is running in docker inside an ec2 instance and it is spawning single-user notebook in other instances of ecs cluster