liveBook · Manning

Amazon Elastic Compute Cloud

As explained in Build Python Web Apps with Streamlit

Amazon EC2 is an AWS service that provides resizable virtual machines for running applications.

Amazon EC2 provides virtual machines in the cloud for hosting applications. Instead of buying and maintaining physical servers, you rent computing power and scale the infrastructure as application traffic changes. section 12.3.1

A deployed application can run inside a Docker container on an EC2 instance. A load balancer receives browser requests, sends them to an available instance, and returns the container’s response. Multiple instances allow traffic to be balanced across the application. section 12.3.3

Using EC2 through Elastic Beanstalk involves several practical decisions:

  • Choose a Docker platform, such as Docker running on 64-bit Amazon Linux 2023. section 12.3.6
  • Set up SSH and a key pair so you can access the underlying instance when diagnosing problems. section 12.3.6
  • Create an environment that provisions EC2 instances, storage, networking rules, a Docker environment, and a load balancer automatically. section 12.3.3
  • Deploy updated application versions with the EB CLI after the environment is running. section 12.3.6

A containerized Streamlit deployment

A Streamlit application runs locally inside a Docker container and is then deployed to EC2 through Elastic Beanstalk. The platform uploads the application archive, launches the environment, and makes the application available through a hosted URL. section 12.3.3 section 12.3.6

Figure 12.4 The end state of the deployed Streamlit app on AWS

Use the architecture figure to follow a request from the browser through the load balancer and EC2 instance to the Dockerized application. section 12.3.3

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains EC2 through request routing, containers, load balancing, provisioning, and SSH troubleshooting, but not instance administration internals.
Examples
Uses a Dockerized Streamlit application deployed through Elastic Beanstalk to illustrate EC2 instances and request handling.
What it assumes
Assumes a Dockerfile-based application and AWS credentials while introducing cloud infrastructure and SSH concepts.
What you can do after
Operate a containerized application on EC2 through Elastic Beanstalk and diagnose selected instance-level deployment problems using SSH.
How it connects
Connects virtual machines with Docker, Elastic Beanstalk, load balancers, S3, IAM, and AWS Certificate Manager.

Also explained in

Compare how 3 books explain Amazon Elastic Compute Cloud →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.