Skip to content

Creating AWS Virtual Private Cloud (VPC) and networking resources using Terraform, including subnets, route tables, internet gateways, and security groups.

Notifications You must be signed in to change notification settings

manas-shinde/terraform-aws-vpc-networking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-vpc-networking

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.

Prerequisites

  • 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.

Repository Structure

  1. versions.tf: Defines the required Terraform and AWS provider versions.

  2. providers.tf: Configures the AWS provider and specifies the region for deployment.

  3. vpc.tf: Contains all the networking resources, including the VPC, public and private subnets, internet gateway, and the public route table.

  4. ec2.tf: Defines the EC2 instance that will be created within the public subnet.

How to Deploy

Follow these steps to deploy your static website:

  1. Clone the Repository:

    git clone https://github.com/manas-shinde/terraform-aws-vpc-networking
    cd terraform-aws-vpc-networking
  2. Initialize Terraform: This command downloads the necessary provider plugins.

    terraform init
  3. Review the Plan: This command shows you what Terraform will create, modify, or destroy.

    terraform plan
  4. Apply the Configuration: This command creates the resources in your AWS account. Type yes when prompted to proceed.

    terraform apply

How to Destroy

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.

About

Creating AWS Virtual Private Cloud (VPC) and networking resources using Terraform, including subnets, route tables, internet gateways, and security groups.

Topics

Resources

Stars

Watchers

Forks

Languages