In this tutorial, you will manually deploy the NetflixMovieCatalog service on an AWS virtual machine.
-
In an AWS account, create an EC2 instance (if haven't done yet).
-
Run the NetflixMovieCatalog within your instance as a Linux service1 that starts automatically when the instance is starting. Create Python
venv
and install dependencies if needed. -
In Route 53, configure a subdomain in the hosted zone of your domain to route traffic your instance IP.
-
Access the service domain via your browser and make sure it's accessible, open relevant port in your instance's Security Group.
-
Now, configure your Flask application to accept only HTTPS traffic by generating a self-signed certificate:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
Then, update the Flask app code to use the certificate, as follows:
- app.run(port=8080, host='0.0.0.0') + app.run(port=8080, host='0.0.0.0', ssl_context=('cert.pem', 'key.pem'))
While
cert.pem
andkey.pem
are paths to your generated certificate and private key. -
Visit your service via your browser by:
https://your-subdomain.devops-days-upes.com:8080
(changeyour-subdomain
accordingly).