Skip to main content

AWS Infrastructure Automation

Objective#

The objective of this project is to automate the provisioning of AWS infrastructure resources using Terraform. It provides a set of Terraform configuration files that create a VPC, subnet, route table, security group, S3 bucket, and an EC2 instance on AWS.

GitLab Repository URL: AWS Infra Automation Repository

Deployment Steps#

Follow the steps below to deploy the infrastructure using Terraform:

  1. Clone the repository:

    git clone https://gitlab.com/bibinjoy2255/aws-infra-automation
  2. Change into the cloned directory:

    cd aws-infra-automation
  3. Update the main.tf file: Update the main.tf file with your AWS credentials, desired region, AMI ID, key pair name, etc. This file contains the Terraform configuration for creating the infrastructure resources.

  4. Initialize Terraform:

    terraform init
  5. Review planned changes:

    terraform plan
  6. Apply changes:

    terraform apply

    Terraform will prompt for confirmation before proceeding. Enter yes to continue.

  7. Infrastructure Destruction (Cleanup): To destroy the created resources and clean up, run:

    terraform destroy

Configuration#

The main Terraform configuration file main.tf contains the resource definitions for creating the following resources:

  • VPC: Defines the virtual private cloud.
  • Subnet: Specifies the subnet within the VPC.
  • Route Table: Creates a route table for the VPC.
  • Route Table Association: Associates the subnet with the route table.
  • Security Group: Defines the inbound and outbound traffic rules.
  • S3 Bucket: Creates an S3 bucket with a given name.
  • EC2 Instance: Launches an EC2 instance within the specified subnet and security group.

Make sure to update the configuration file with your specific settings and requirements.