My notes and learnings from Day 01 of #30DaysOfAWSTerraform
Today I started Day 01 of the 30 Days of AWS Terraform challenge by Piyush Sachdeva, and this session gave me my very first look into Terraform and Infrastructure as Code (IaC). Even though it was the introductory lesson, it helped me finally understand why IaC matters and how Terraform fits perfectly into modern cloud and DevOps workflows.
π What Is Infrastructure as Code (IaC)?
Infrastructure as Code (IaC) is a way of managing cloud infrastructure using code instead of manually configuring everything from the AWS console.
With IaC, your setup becomes:
β Predictable
β Repeatable
β Automated
β Version-controlled
β Easy to recreate in any environment
Basically, IaC removes human error and brings structure to infrastructure management.
π οΈ What Is Terraform?
Terraform is an open-source IaC tool created by HashiCorp. It lets you define infrastructure using configuration files written in HCL (HashiCorp Configuration Language).
π Key points I learned:
- Terraform supports multi-cloud: AWS, Azure, GCP, Kubernetes, and more
- It follows a declarative approach β define what you want, Terraform decides how to build it
- It tracks real resources through a state file (
terraform.tfstate) - It automates provisioning and prevents manual mistakes
- Terraform becomes the single source of truth for your cloud infrastructure.
One thing that stood out to me was Terraform's state file. Terraform stores the details of all created resources inside a file called
terraform.tfstate. This helps Terraform understand what already exists and what changes need to be made.
Terraform Workflow:
The core Terraform workflow, which is actually very simple:-
-
Write -> Create
.tffile. - Init -> Downloads provider plugins.
- Plan -> Shows what Terraform will create or modify.
- Apply -> Makes the actual changes in your cloud account.
- Destroy -> Declares everything when you're done. This workflow makes Terraform predictable and safe.
write -> Init -> Plan -> Apply -> Destroy
+----------------------+
| Terraform Config |
| (.tf files) |
+----------+-----------+
|
v
+----------------------+
| terraform init |
| (download providers) |
+----------+-----------+
|
v
+----------------------+
| terraform plan |
| (preview changes) |
+----------+-----------+
|
v
+----------------------+
| terraform apply |
| (create resources) |
+----------+-----------+
|
v
+----------------------+
| Cloud Infrastructure |
+----------------------+
π¦ Simple Terraform Example (From Day 01)
Hereβs a basic configuration that creates an EC2 instance in AWS:
resource "aws_instance" "my_ec2" {
ami = "ami-0e472ba40eb589f49" # Amazon Linux 2 AMI (ap-south-1)
instance_type = "t2.micro" # Free-tier eligible
tags = {
Name = "AWS_Terraform_EC2_Instance"
}
}







Top comments (1)
Very informative...
Kindly tag me for further notes.