This project uses Terraform to deploy a Flask application to AWS Elastic Beanstalk. It provisions the necessary infrastructure, including:
✅ VPC, Subnet, Internet Gateway
✅ Security Group for Beanstalk
✅ S3 Bucket for Flask app ZIP
✅ IAM Role & Instance Profile for Beanstalk
✅ Elastic Beanstalk Application & Environment
✅ Application Version linked to S3 ZIP
- A Flask app is packaged into a
.zip
file and uploaded to an S3 bucket. - Terraform provisions an Elastic Beanstalk environment to deploy the Flask app.
- The app is accessible via an auto-generated AWS Beanstalk URL.
Ensure you have the following installed:
- Terraform
- AWS CLI (configured with credentials)
- Python 3+
- Flask (if you want to test locally)
Ensure flask-app.zip
is present in your working directory:
zip -r flask-app.zip .ebextensions/ static/ requirements.txt application.py
terraform init
This will provision AWS resources and deploy the Flask app:
terraform apply -auto-approve
Once deployment is complete, navigate to AWS Console → Elastic Beanstalk → flask-app-env and find the Application URL.
Open your browser and go to:
http://<your-beanstalk-url>
To remove all resources:
terraform destroy -auto-approve
├── main.tf # Terraform configuration
├── flask-app.zip # Flask app archive (uploaded to S3)
├── app.py # Flask application
├── static/
│ └── index.html # Vue.js frontend
├── .ebextensions/
│ └── python.config # Elastic Beanstalk configuration
├── README.md # Documentation (this file)
├── requirements.txt # required modules
💡 Created by Anton Aks - Feel free to contribute and improve!
Happy coding! 🚀