This repository contains Terraform configuration to deploy a basic network setup (VPC, subnets, internet gateway, and route table) and a single EC2 instance within that network on AWS. The configuration is broken down into separate files for better organization and readability.
-
Terraform: Ensure you have Terraform installed on your system.
-
AWS Account: You need an active AWS account with the necessary permissions.
-
AWS CLI: Your AWS credentials must be configured locally.
-
versions.tf
: Defines the required Terraform and AWS provider versions. -
providers.tf
: Configures the AWS provider and specifies the region for deployment. -
vpc.tf
: Contains all the networking resources, including the VPC, public and private subnets, internet gateway, and the public route table. -
ec2.tf
: Defines the EC2 instance that will be created within the public subnet.
Follow these steps to deploy your static website:
-
Clone the Repository:
git clone https://github.com/manas-shinde/terraform-aws-vpc-networking cd terraform-aws-vpc-networking
-
Initialize Terraform: This command downloads the necessary provider plugins.
terraform init
-
Review the Plan: This command shows you what Terraform will create, modify, or destroy.
terraform plan
-
Apply the Configuration: This command creates the resources in your AWS account. Type
yes
when prompted to proceed.terraform apply
To tear down all the resources created by this configuration, run the following command:
terraform destroy
Warning: This will permanently delete the VPC, subnets, and EC2 instance.