Using CI/CD to Deploy Infrastructure to AWS with Terraform through Git Action

✨ Objective:

Provision a full AWS infrastructure using Terraform that includes:

We already set up a Dockerized self-hosted GitHub runner.

The steps below shows the modules used by terraform to configure our infrastructure.

Step 1 Terraform Provider & Backend Setup

  1. Configured the AWS Provider in provider.tf:

    provider "aws" {
      region  = "eu-north-1"
      profile = "default"
    }
    
    

Step 2: VPC & Networking

Module used: module-vpc

  1. Created the VPC with a CIDR block of 192.168.0.0/16.
  2. Defined:
  3. Added an Internet Gateway.
  4. Deployed a NAT Gateway in one of the public subnets.