Day 1 – Introduction to Terraform and Infrastructure as Code

Introduction

I recently started the 30 Days AWS Terraform Challenge to strengthen my understanding of Infrastructure as Code and cloud automation.

Day 1 focused on the fundamentals. It may sound basic, but it sets the foundation for everything that follows. The shift from manual provisioning to automated infrastructure is not just a technical improvement. It is a mindset change.


What is Terraform and Infrastructure as Code

Terraform, developed by HashiCorp, is a tool that allows us to define cloud infrastructure using code.

Infrastructure as Code means we describe resources such as virtual machines, storage, and networks in configuration files instead of creating them manually through a console.

This approach makes infrastructure:

  • Repeatable
  • Consistent
  • Version-controlled
  • Easy to scale

Instead of remembering steps, we define the desired state and let Terraform handle the execution.


Problems with Manual Infrastructure

Before Infrastructure as Code, most systems were built manually.

This creates several challenges:

  • Human errors are common
  • No clear record of what changed
  • Difficult to replicate environments
  • Time-consuming for large systems

As environments grow, these problems multiply. What works for one server does not work for fifty.


Benefits of Terraform

Terraform addresses these problems through automation.

Key benefits include:

  • Declarative approach where you define what you want
  • Execution plan that shows changes before applying
  • Ability to reuse configurations
  • Works across multiple cloud providers

One feature that stood out to me is the planning phase. Terraform shows what will happen before making changes, which reduces risk significantly.


Terraform Workflow

The basic Terraform workflow is simple:

  1. Write configuration files
  2. Initialize Terraform
  3. Review execution plan
  4. Apply changes

Example commands:

terraform init
terraform plan
terraform apply

This workflow ensures that infrastructure changes are predictable and controlled.


Simple Terraform Example

Below is a basic example of creating an AWS S3 bucket:

provider "aws" {
region = "us-east-1"
}

resource "aws_s3_bucket" "example_bucket" {
bucket = "my-terraform-demo-bucket-123"
}

With just a few lines of code, we can create cloud resources without logging into the AWS console.


High-Level Architecture

A simple way to think about Terraform:

  • You write code
  • Terraform communicates with cloud APIs
  • Resources are created automatically

You define the desired state, and Terraform ensures the infrastructure matches that state.


My Key Takeaway

The biggest takeaway from Day 1 is this:

Infrastructure should be treated like code.

This enables better collaboration, tracking, and reliability. As someone working in cloud and data platforms, this aligns closely with my goal of moving toward cloud architecture and building scalable systems.


What’s Next

This is just the beginning.

Over the next few days, I will explore deeper concepts, build real infrastructure, and continue sharing my learnings.


Video Reference



Jay

Comments

Popular posts from this blog

ASM Integrity check failed with PRCT-1225 and PRCT-1011 errors while creating database using DBCA on Exadata 3 node RAC

Lock Tables in MariaDB

Life is beautiful