Serve Streamlit app via SSL

0

I have a Streamlit app running on an EC2 instance on port 8501 (default for Streamlit).

I now need to serve this app on a sub-domain (ex: https://mysubdomain.xyz.com). I have purchased my domain on Route 53 with an SSL certificate which I have received from ACM (AWS Certificate Manager).

Any suggestions on how I can achieve this with minimal additional technologies? Also, if possible I'd like to avoid using an application load balancer.

On the other hand, I can (if necessary) use Cloudfront (because it's free for my minimal usage).

1 Answer
1

Create a CloudFront distribution whose custom source is the EC2 instance https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistS3AndCustomOrigins.html#concept_CustomOrigin

Associate the ACM cert with the CloudFront distribution https://repost.aws/knowledge-center/install-ssl-cloudfront

You mention a Route 53 subdomain, if that's something you choose to do then this will help https://repost.aws/knowledge-center/create-subdomain-route-53

profile picture
EXPERT
Steve_M
answered 25 days ago
  • Thank you for your response.

    I followed the article's steps for Cloudfront (not yet gotten to ACM cert) and I'm getting the following error: """ 504 ERROR The request could not be satisfied. CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. Generated by cloudfront (CloudFront) Request ID: Tlx3w7yS_9o5xPxGDSRCA9aUt7p5DXNh3fNvxYqsKLk5ddyLhkm6Eg== """

    Any thoughts on how to trouble shoot?

    My app is up and running and is accessible via the public Internet on port 8051. I've set up the necessary inbound security group rule on EC2 for this purpose.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions