Project Overview
This project uses Terraform to provision an EC2 instance on AWS and Ansible to configure it with a Flask application, enabling a seamless Infrastructure-as-Code workflow.
Key Features
- Infrastructure as Code (IaC): Automates the provisioning of an AWS EC2 instance using Terraform.
- Configuration Management: Installs and configures a Python Flask application using Ansible.
- Automation: Uses Bash scripting to streamline the entire process from provisioning to deployment.
- Modular Structure: Clean separation of concerns with dedicated folders for Terraform, Ansible, and scripts.
- Repeatable Workflow: Easily reproducible setup for consistent and reliable infrastructure and application deployment.
How it works
- Terraform provisions an EC2 instance on AWS and outputs its public IP.
- A Bash script captures the public IP and dynamically updates the Ansible inventory file.
- Ansible connects to the instance via SSH and:
- Installs required packages (Python3, pip, Flask)
- Clones or sets up the Flask app
- Runs the Flask application
- The Flask app becomes accessible via the EC2 public IP.