This project automates the deployment of a Docker container of a Python Flask application on AWS EC2 instances using Terraform Provisioners. It creates a streamlined and consistent deployment pipeline, leveraging AWS infrastructure components such as VPCs, subnets, security groups, and EC2 instances.
- Automated Deployment: Deploys a simple Flask application to AWS EC2 instances.
- Infrastructure as Code: Utilizes Terraform to define and provision AWS resources.
- Consistency: Ensures repeatable and consistent deployments.
- Terraform: Ensure you have Terraform installed on your local machine. You can download it from terraform.io.
- AWS Account: You need an AWS account to provision resources.
- AWS CLI: Optionally, you can install the AWS CLI to manage AWS resources from the command line.
Name | Version |
---|---|
aws | 5.67.0 |
No custom modules are used in this project.
This project uses the following AWS resources:
Name | Type |
---|---|
aws_instance.server | EC2 Instance |
aws_internet_gateway.igw | Internet Gateway |
aws_key_pair.ruben_key | Key Pair |
aws_route_table.RT | Route Table |
aws_route_table_association.RTA | Route Table Association |
aws_security_group.webSG | Security Group |
aws_subnet.ruben_subnet | Subnet |
aws_vpc.ruben_vpc | VPC |
The following inputs are required for the configuration:
Name | Description | Type | Default | Required |
---|---|---|---|---|
ami_id |
AMI ID for the EC2 instance | string |
n/a | yes |
instance_type |
Type of EC2 instance | string |
n/a | yes |
key_name |
Name of the SSH key pair | string |
n/a | yes |
region |
AWS region for deployment | string |
"us-east-1" |
no |
sg-name |
Security Group name | string |
n/a | yes |
subnet-az |
Availability Zone for the subnet | string |
n/a | yes |
subnet-cidr |
CIDR block for the subnet | string |
n/a | yes |
vpc-cidr |
CIDR block for the VPC | string |
n/a | yes |
This project outputs the following information:
Name | Description |
---|---|
Project_1_link |
URL to access the deployed application |
- Clone the Repository:
git clone https://github.com/yourusername/Deploying-Python-Flask-Application-on-AWS-Cloud-using-Terraform-Provisioners.git cd Deploying-Python-Flask-Application-on-AWS-Cloud-using-Terraform-Provisioners