This project automates the provisioning of AWS infrastructure using Python and Boto3. It creates a VPC, Internet Gateway, Subnet, Route Table, and launches an EC2 instance.
- VPC Creation: Creates a Virtual Private Cloud with CIDR
10.0.0.0/16. - Internet Access: Sets up an Internet Gateway and Route Table for public access.
- Subnet: Provisions a public subnet (
10.0.1.0/24) inus-east-1. - EC2 Instance: Launches a
t2.microUbuntu instance with a public IP. - Security Group: Creates a security group allowing HTTP access.
- Python 3.x
- AWS Account
- AWS CLI configured with credentials (
aws configure) boto3library installed
-
Clone the repository:
git clone https://github.com/Smilin01/aws-infra-automation.git cd aws-infra-automation -
Install dependencies:
pip install -r requirements.txt
Run the script to provision the infrastructure:
python src/provision_vpc.pyThe script will output the progress and finally display the Instance ID and Public IP of the created EC2 instance.
- Region: Defaults to
us-east-1. Modifyregion_nameinsrc/provision_vpc.pyto change. - AMI ID: The script uses
ami-0c7217cdde317cfec(Ubuntu 22.04 LTS). Ensure this AMI ID is valid for your selected region.