I have a flask app that I am depoying on an EC2 instance. The app starts just fine:
ubuntu@ip-something:~/webservices$ python service/texting_service.py
* Serving Flask app "texting_service" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 146-396-474
When I ssh
into this EC2 instance and call the service using localhost
, it returns the expected response. However, when I try to call this service from outside the EC2 instance using the instance's public IP address I see this error:
curl: (7) Failed to connect to ec2.instance.ip.address port 8080: Connection refused
I confirmed that I have opened the ingress port 8080
for the security group attached to this EC2 instance. What am I missing?