Skip to content

Terraform code for provisioning an AWS Virtual Private Cloud (VPC) infrastructure. It automates the creation of VPC components such as subnets, route tables, and internet gateways. GitHub Actions are used for CI/CD to ensure infrastructure as code deployment.

Notifications You must be signed in to change notification settings

iam-abhishek-yadav/VPC_with_Terraform_And_Github_Actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terraform VPC Creation and Destruction

This repository contains Terraform configurations for creating and destroying an AWS Virtual Private Cloud (VPC).

Prerequisites

Before using this Terraform configuration, ensure that you have the following prerequisites set up:

  1. AWS Account: You need an AWS account to create and manage resources.
  2. Terraform Installed: Ensure that Terraform is installed on your local machine. You can download it from Terraform's official website.

Configuration

AWS S3 Bucket for Terraform Backend

Create an S3 bucket in your AWS account named terraform-backend-s3-github to be used as the backend for Terraform state. If this name is not available, create a new one.

Update the terraform_vpc/providers.tf file with the correct bucket name.

backend "s3" {
    bucket = "bucket_name"
    key    = "dev/terraform.tfstate"
    region = "us-east-1"
  }

Usage

  1. Initialize Terraform:

    Run the initialization command.

    terraform init
  2. Create VPC:

    To create the VPC, follow the relevant Terraform command.

    terraform apply --auto-approve
  3. Destroy VPC:

    To destroy the VPC and associated resources, follow the relevant Terraform command.

    terraform destroy --auto-approve

Cleanup

After you have finished using the infrastructure, it's recommended to destroy it to avoid incurring unnecessary charges. Follow the "Destroy VPC" instructions mentioned above.

About

Terraform code for provisioning an AWS Virtual Private Cloud (VPC) infrastructure. It automates the creation of VPC components such as subnets, route tables, and internet gateways. GitHub Actions are used for CI/CD to ensure infrastructure as code deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages