Request a certificate for the domain or subdomain of the URL of your desired app (myapp.domain.com) in AWS Certificate Manager
Run your app on EC2 (on an elastic IP)
Create an application load balancer with the SSL certificate that you created in the 2nd step, and target groups pointing to your EC2 IP.
Allow the EC2 access from the load balancer security group on 8501
Add additional listener rules to reroute HTTP to HTTPS
Note that there are other steps to check regarding security groups (who should be able to access the load balancer vs the server running Streamlit), proper records in the hosted zones for the domain, using the right ports in all the steps (443, 80, 8501) etc etc.
This is as simple as it can get in an AWS environment. The load balancer handles all traffic and the SSL protocols, and the EC2 instance runs faster this way running only Streamlit code.
Thanks all! I was running on AWS, but my domain was NOT in AWS (squarespace), so doing the load balancer route gets complicated - you have to do a Network Load Balancer in front of, and I couldn’t figure how to get all the balancers and targets to seeming work together. So I heavily borrowed from @Dhruv4 's great post - here was my entire thing, beginning to end, on a clean machine
Start a small instance on AWS using a stock ubuntu AMI
Set up a security group that allows HTTP, HTTPS, and SSH traffic
Register an Elastic IP address, and assign it to the instance
Go to domain registrar, and assign @ and www to the IP address