Goal
I wanted to explore AWS App Runner, so I deployed a basic Python Flask application that connects to a database and returns a list of posts.
Deployment steps
- Go to AWS App Runner and start creating a new service.
- Choose GitHub as the source. You’ll need to authorize access, but AWS guides you through it with a few pop-up prompts.
- Select the desired branch and enable automatic deployment triggers.
- I initially selected the
Python 3.11runtime, but due to some errors, I switched toPython 3.9. - Fill in the required fields:
- Build command:
pip install -r requirements.txt - Start command:
flask run --host=0.0.0.0 --port=8080 - Port:
8080
- Build command:
- Choose the simplest and cheapest instance type.
- Set environment variables manually, though using secrets is also supported.
- Leave the other settings as default.
- Click Save and Deploy. After a few minutes, a default domain is provided for accessing the application.
- In my case, I linked the service to a custom subdomain registered through Route 53.
Result
The application was up and running in just a few minutes, with automatic deployment and a custom domain. AWS App Runner proved to be a convenient option for deploying small to medium apps, especially for those already using AWS services.