<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amit Singh Deora</title>
    <description>The latest articles on DEV Community by Amit Singh Deora (@amitsinghs98).</description>
    <link>https://dev.to/amitsinghs98</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3406714%2Fe05dab3e-cdd1-4e6c-92bc-b16529d92a76.jpg</url>
      <title>DEV Community: Amit Singh Deora</title>
      <link>https://dev.to/amitsinghs98</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amitsinghs98"/>
    <language>en</language>
    <item>
      <title>Day 4 AWS Terraform— Understanding Terraform State &amp; Remote Backend (Made Simple)</title>
      <dc:creator>Amit Singh Deora</dc:creator>
      <pubDate>Sat, 20 Dec 2025 18:05:57 +0000</pubDate>
      <link>https://dev.to/amitsinghs98/day-4-aws-terraform-understanding-terraform-state-remote-backend-made-simple-360i</link>
      <guid>https://dev.to/amitsinghs98/day-4-aws-terraform-understanding-terraform-state-remote-backend-made-simple-360i</guid>
      <description>&lt;p&gt;Terraform is powerful, but understanding how it keeps track of your infrastructure is even more important. On Day 4, I learned the secret behind Terraform’s “memory” — the state file — and why moving it to a remote backend is a must for real-world DevOps work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Exactly Is the Terraform State File?
&lt;/h2&gt;

&lt;p&gt;Whenever Terraform creates a resource, it needs to remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What was created&lt;/li&gt;
&lt;li&gt;Its attributes&lt;/li&gt;
&lt;li&gt;Its unique IDs&lt;/li&gt;
&lt;li&gt;Current configuration details
All of this is stored in a file called:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;terraform.tfstate&lt;/code&gt;&lt;br&gt;
This file is the source of truth for Terraform.&lt;br&gt;
It helps Terraform compare two things:&lt;/p&gt;

&lt;p&gt;🟢 Desired State&lt;br&gt;
What I define in .tf files (like creating an S3 bucket, EC2 instance, VPC).&lt;/p&gt;

&lt;p&gt;🔵 Actual State&lt;br&gt;
What actually exists in AWS right now.&lt;/p&gt;

&lt;p&gt;Terraform compares both and decides whether to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create&lt;/li&gt;
&lt;li&gt;Update&lt;/li&gt;
&lt;li&gt;Delete
a resource.
This is the heart of Infrastructure as Code.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Why Local State is Dangerous
&lt;/h2&gt;

&lt;p&gt;By default, the state file is created locally, which is risky because:&lt;/p&gt;

&lt;p&gt;❌ It contains sensitive data&lt;br&gt;
❌ It can be deleted accidentally&lt;br&gt;
❌ It cannot be shared with a team&lt;br&gt;
❌ Multiple people modifying it can corrupt it&lt;/p&gt;

&lt;p&gt;This is where remote state storage becomes essential.&lt;/p&gt;


&lt;h2&gt;
  
  
  Using a Remote Backend (AWS S3)
&lt;/h2&gt;

&lt;p&gt;A remote backend stores the state file in a secure, centralized location.&lt;br&gt;
For AWS users, the most common choice is S3.&lt;/p&gt;
&lt;h2&gt;
  
  
  Benefits of Remote Backend
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Safe and encrypted storage&lt;/li&gt;
&lt;li&gt;Easy collaboration within teams&lt;/li&gt;
&lt;li&gt;Supports versioning&lt;/li&gt;
&lt;li&gt;Can be accessed by CI/CD pipelines&lt;/li&gt;
&lt;li&gt;Prevents conflicts using state locking&lt;/li&gt;
&lt;li&gt;The state file now lives in S3, not on your laptop.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  What Is State Locking?
&lt;/h2&gt;

&lt;p&gt;Terraform operations must happen one at a time.&lt;br&gt;
If two users run &lt;code&gt;terraform apply&lt;/code&gt; simultaneously, the state file can get corrupted.&lt;/p&gt;

&lt;p&gt;State locking ensures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only one process uses the state at a time&lt;/li&gt;
&lt;li&gt;Others must wait until the lock is released
Earlier, Terraform used DynamoDB for locking.
Now S3 supports &lt;code&gt;use_lockfile = true&lt;/code&gt;, making it much simpler.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/YsEdrl9O5os"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkn8j4thtxv4vln3wfev.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkn8j4thtxv4vln3wfev.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the Setup
&lt;/h2&gt;

&lt;p&gt;With the backend configured, commands like:****&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;terraform init&lt;/li&gt;
&lt;li&gt;terraform plan&lt;/li&gt;
&lt;li&gt;terraform apply
now interact with the remote state file inside S3.
You can even run:&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  List resources:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;terraform state list&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Show resource details:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;terraform state show &amp;lt;resource_name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Remove resource from state (advanced):
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;terraform state rm &amp;lt;resource_name&amp;gt;&lt;/code&gt;&lt;br&gt;
These commands help you understand and manage the state without touching the file manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways from Day 4
&lt;/h2&gt;

&lt;p&gt;✔ Terraform state file is the memory of your infrastructure&lt;br&gt;
✔ Always store state remotely — never locally&lt;br&gt;
✔ Use S3 for remote backend + built-in locking&lt;br&gt;
✔ Never edit the state file manually&lt;br&gt;
✔ Keep separate state files for dev, test, prod&lt;br&gt;
✔ Use versioning/backups for safety&lt;/p&gt;

&lt;p&gt;Understanding Terraform state changed how I look at Infrastructure as Code.&lt;br&gt;
It’s not just about writing .tf files — it’s about managing your infrastructure’s single source of truth.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>terraform</category>
      <category>awsterraform</category>
    </item>
    <item>
      <title>Day 3 of 30 Days of AWS Terraform — Creating Your First S3 Bucket with Terraform</title>
      <dc:creator>Amit Singh Deora</dc:creator>
      <pubDate>Sat, 20 Dec 2025 17:47:47 +0000</pubDate>
      <link>https://dev.to/amitsinghs98/day-3-of-30-days-of-aws-terraform-creating-your-first-s3-bucket-with-terraform-3k1g</link>
      <guid>https://dev.to/amitsinghs98/day-3-of-30-days-of-aws-terraform-creating-your-first-s3-bucket-with-terraform-3k1g</guid>
      <description>&lt;p&gt;Welcome to Day 3 of my 30 Days of AWS Terraform Challenge!&lt;br&gt;
Today marks an important milestone — I wrote my first Terraform configuration that actually creates a real AWS resource, an S3 bucket.&lt;/p&gt;

&lt;p&gt;This might seem simple on the surface, but the concepts learned today build the foundation for every cloud automation task we’ll do going forward.&lt;/p&gt;

&lt;p&gt;Let’s break down the entire process in a beginner-friendly way.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Start with S3?
&lt;/h2&gt;

&lt;p&gt;Amazon S3 is one of the simplest services to automate.&lt;br&gt;
It doesn’t need VPC, networking, or complex dependencies — making it perfect for understanding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How Terraform resources are written&lt;/li&gt;
&lt;li&gt;How provider blocks work&lt;/li&gt;
&lt;li&gt;How to run Terraform commands&lt;/li&gt;
&lt;li&gt;How a state file tracks your AWS infrastructure
If you’re learning Infrastructure as Code, this is the ideal first step.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6rhfx20dklb2aqjhba4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6rhfx20dklb2aqjhba4.png" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Folder Setup
&lt;/h2&gt;

&lt;p&gt;Inside my project, I created a new folder:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;day03/&lt;br&gt;
And inside it:&lt;/p&gt;

&lt;p&gt;main.tf&lt;br&gt;
Terraform does not care about the filename; it only cares that the extension is .tf.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Writing the S3 Bucket Configuration
&lt;/h2&gt;

&lt;p&gt;From the official Terraform documentation, the S3 resource block looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "aws_s3_bucket" "firstbucket" {
  bucket = "my-demo-bucket-123"
  tags = {
    Name        = "MyBucket"
    Environment = "Dev"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatol573yrbz8jl79ni78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatol573yrbz8jl79ni78.png" alt=" " width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What this means:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;aws_s3_bucket → Terraform resource type&lt;/li&gt;
&lt;li&gt;firstbucket → internal name used for referencing&lt;/li&gt;
&lt;li&gt;bucket → must be globally unique&lt;/li&gt;
&lt;li&gt;tags → key–value metadata
Just like that, our infrastructure is defined as code.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Running the Terraform Workflow
&lt;/h2&gt;

&lt;p&gt;Terraform has a very predictable 4-step workflow:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. terraform init&lt;/strong&gt;&lt;br&gt;
This command downloads the AWS provider plugin and prepares your working directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform init&lt;/code&gt;&lt;br&gt;
You run this whenever you create a new folder or add a new provider.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. terraform plan&lt;/strong&gt;&lt;br&gt;
A dry-run that shows what changes Terraform will make.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform plan&lt;/code&gt;&lt;br&gt;
For today’s code, it shows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Plan: 1 to add, 0 to change, 0 to destroy.&lt;/code&gt;&lt;br&gt;
Meaning Terraform will create 1 resource — our S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. terraform apply&lt;/strong&gt;&lt;br&gt;
Time to actually create the bucket.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform apply&lt;/code&gt;&lt;br&gt;
Terraform asks for confirmation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Enter a value: yes&lt;/code&gt;&lt;br&gt;
Or skip the prompt:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform apply -auto-approve&lt;/code&gt;&lt;br&gt;
Within a few seconds, the new S3 bucket appears in the AWS console!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. terraform destroy&lt;/strong&gt;&lt;br&gt;
To delete everything:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform destroy&lt;/code&gt;&lt;br&gt;
Or:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform destroy -auto-approve&lt;/code&gt;&lt;br&gt;
Terraform cleans up the bucket and returns your environment to original state.&lt;/p&gt;

&lt;p&gt;This “build → modify → destroy” cycle is a huge part of real DevOps workflows.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Terraform Detects Changes
&lt;/h2&gt;

&lt;p&gt;One of the coolest things I learned today:&lt;/p&gt;

&lt;p&gt;Terraform keeps track of all created resources using a local file called:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform.tfstate&lt;/code&gt;&lt;br&gt;
If I update the tag in my code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Name = "MyBucket 2.0"&lt;/code&gt;&lt;br&gt;
And run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;terraform plan&lt;/code&gt;&lt;br&gt;
Terraform compares:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The desired state (my .tf file)&lt;/li&gt;
&lt;li&gt;The actual state (AWS resources)
And says:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;0 to add, 1 to change, 0 to destroy&lt;/code&gt;&lt;br&gt;
This state-management capability is what makes Terraform so powerful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Learnings From Day 3
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to use official Terraform docs effectively&lt;/li&gt;
&lt;li&gt;Understanding resource blocks and provider blocks&lt;/li&gt;
&lt;li&gt;Running init, plan, apply, and destroy&lt;/li&gt;
&lt;li&gt;Importance of globally unique S3 bucket names&lt;/li&gt;
&lt;li&gt;How the Terraform state file tracks real AWS infrastructure&lt;/li&gt;
&lt;li&gt;How Terraform automatically identifies changes and updates resources&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Today was the moment where Terraform “clicked” for me.&lt;br&gt;
Seeing an actual AWS resource being created from a simple .tf file feels like unlocking a new superpower.&lt;/p&gt;

&lt;p&gt;Terraform removes the manual clicking and turns infrastructure into repeatable, version-controlled automation — something every DevOps engineer must master.&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>aws</category>
      <category>awsterraform</category>
    </item>
    <item>
      <title>Terraform Providers: Day2 — Explained Super Simply</title>
      <dc:creator>Amit Singh Deora</dc:creator>
      <pubDate>Sat, 20 Dec 2025 17:06:49 +0000</pubDate>
      <link>https://dev.to/amitsinghs98/terraform-providers-day2-explained-super-simply-1nog</link>
      <guid>https://dev.to/amitsinghs98/terraform-providers-day2-explained-super-simply-1nog</guid>
      <description>&lt;p&gt;This is my Day 2 of 30daysofawsterraform. Thanks to &lt;br&gt;
Piyush Sachdeva for the amazing series. So, let’s begin.&lt;/p&gt;

&lt;p&gt;Before writing Terraform code or creating any AWS resources, you must understand Terraform Providers — because providers are the heart of Terraform.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Terraform Provider?
&lt;/h2&gt;

&lt;p&gt;A provider is a plugin that connects Terraform with the external service you want to manage.&lt;/p&gt;

&lt;p&gt;Think of it like a translator:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You write Terraform in HCL (HashiCorp Configuration Language)&lt;/li&gt;
&lt;li&gt;AWS, Azure, GCP, Docker, Kubernetes — they don’t understand HCL&lt;/li&gt;
&lt;li&gt;So the provider converts your Terraform code → into the API calls that AWS/Azure/GCP understand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
If you write Terraform to create an S3 bucket, Terraform uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS provider&lt;/li&gt;
&lt;li&gt;Which calls the AWS S3 API&lt;/li&gt;
&lt;li&gt;And creates the bucket for you
So Terraform never creates resources directly — the provider does it for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/JFiMmaktnuM"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Terraform has 3 types of providers:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Official Providers
Maintained by HashiCorp
Examples:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;AWS&lt;/li&gt;
&lt;li&gt;Azure&lt;/li&gt;
&lt;li&gt;GCP&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Partner Providers
Maintained by the official company but not HashiCorp
Example:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Cloudflare&lt;/li&gt;
&lt;li&gt;Datadog&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Community Providers
Maintained by the open-source community
Example:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Random&lt;/li&gt;
&lt;li&gt;HTTP provider&lt;/li&gt;
&lt;li&gt;Local provider&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where Providers Live: registry.terraform.io
&lt;/h2&gt;

&lt;p&gt;When you search “Terraform AWS provider” on Google, you see:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;registry.terraform.io/providers/hashicorp/aws&lt;/em&gt;&lt;br&gt;
This page shows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All services supported by the AWS provider&lt;/li&gt;
&lt;li&gt;All available resource types (EC2, VPC, IAM, S3, etc.)&lt;/li&gt;
&lt;li&gt;All version numbers&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Example usage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How Does Terraform Download a Provider?&lt;/strong&gt;&lt;br&gt;
When you run:&lt;br&gt;
&lt;code&gt;terraform init&lt;/code&gt;&lt;br&gt;
Terraform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reads your provider block&lt;/li&gt;
&lt;li&gt;Contacts the Terraform Registry&lt;/li&gt;
&lt;li&gt;Downloads the correct provider version&lt;/li&gt;
&lt;li&gt;Stores it in a folder called .terraform&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This folder contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provider plugin (binary)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lock files&lt;br&gt;
Based on OS, the plugin file(provider) format changes; created after “tf init”:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Windows → .exe&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mac → .darwin&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linux → .linux&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Provider Block Explained
&lt;/h2&gt;

&lt;p&gt;A basic provider block looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~&amp;gt; 6.0"
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;provider "aws" {
  region = "us-east-1"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Points:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;required_providers&lt;/code&gt;&lt;br&gt;
Defines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which providers Terraform should use&lt;/li&gt;
&lt;li&gt;Version of each provider&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ Never hard-code AWS access key + secret key inside provider block — security risk.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Provider Version vs Terraform Version
&lt;/h2&gt;

&lt;p&gt;There are TWO versions:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Terraform Core version&lt;/strong&gt;&lt;br&gt;
Example:&lt;br&gt;
&lt;code&gt;required_version = "&amp;gt;= 1.0"&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Provider version&lt;/strong&gt;&lt;br&gt;
Example:&lt;br&gt;
&lt;code&gt;version = "~&amp;gt; 6.0"&lt;/code&gt;&lt;br&gt;
These versions are independent, meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terraform core is maintained by HashiCorp&lt;/li&gt;
&lt;li&gt;AWS provider is maintained by AWS
Because both are maintained separately → compatibility issues can happen
That’s why we lock provider versions.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Version Constraint Operators (Very Important)
&lt;/h2&gt;

&lt;p&gt;You saw symbols like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;= Equal to&lt;/li&gt;
&lt;li&gt;!= Not equal&lt;/li&gt;
&lt;li&gt;&amp;gt; / &amp;lt; Greater/less&lt;/li&gt;
&lt;li&gt;&lt;p&gt;~&amp;gt; Pessimistic operator (most used)&lt;br&gt;
&lt;strong&gt;Most important one: ~&amp;gt; (tilde greater-than)&lt;/strong&gt;&lt;br&gt;
Example:&lt;br&gt;
&lt;code&gt;version = "~&amp;gt; 6.0"&lt;/code&gt;&lt;br&gt;
This means:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accept version 6.0.x&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Accept version 6.1, 6.2… 6.10&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;❌ BUT don’t accept 7.0+ (major version changes)&lt;br&gt;
This protects you from breaking changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Why Not Always Use Latest Provider Version?
&lt;/h2&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New versions may introduce breaking changes&lt;/li&gt;
&lt;li&gt;Some resources may behave differently&lt;/li&gt;
&lt;li&gt;Your Terraform code may break
So we lock versions until we test the newer ones in a dev environment.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Creating Resources Using Providers
&lt;/h2&gt;

&lt;p&gt;A resource example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "aws_vpc" "example" {
  cidr_block = "10.0.0.0/16"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;resource → Terraform keyword&lt;/li&gt;
&lt;li&gt;"aws_vpc" → resource type from provider&lt;/li&gt;
&lt;li&gt;"example" → local Terraform name (internal reference)
You can refer to this resource elsewhere:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;vpc_id = aws_vpc.example.id&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Commands Used
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Initialize provider
&lt;code&gt;terraform init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check what Terraform will create
&lt;code&gt;terraform plan&lt;/code&gt;
Shows:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;What will be added&lt;/li&gt;
&lt;li&gt;What will be changed&lt;/li&gt;
&lt;li&gt;What will be destroyed&lt;/li&gt;
&lt;li&gt;Apply changes (create actual resource)
&lt;code&gt;terraform apply&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Your Plan Failed?
&lt;/h2&gt;

&lt;p&gt;It failed because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your IAM user only had S3 access&lt;/li&gt;
&lt;li&gt;But you tried to create VPC&lt;/li&gt;
&lt;li&gt;So AWS denied it
Terraform plan doesn’t call the API → but apply will fail.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Terraform State (not explained deeply here)
&lt;/h2&gt;

&lt;p&gt;Terraform creates a file:&lt;br&gt;
&lt;code&gt;terraform.tfstate&lt;/code&gt;&lt;br&gt;
This file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tracks what resources Terraform manages&lt;/li&gt;
&lt;li&gt;Compares real environment vs Terraform code&lt;/li&gt;
&lt;li&gt;Ensures idempotency (same outcome every time)
State is a very big topic — later in your series.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Summary (Super Easy)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feav72rn525j17hcz6k2l.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feav72rn525j17hcz6k2l.webp" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;




</description>
      <category>terraform</category>
      <category>awsterraform</category>
      <category>aws</category>
      <category>terraformprovider</category>
    </item>
    <item>
      <title>Terraform with AWS- Day1: Why Terraform Matters &amp; How It Really Works</title>
      <dc:creator>Amit Singh Deora</dc:creator>
      <pubDate>Thu, 18 Dec 2025 19:41:22 +0000</pubDate>
      <link>https://dev.to/amitsinghs98/terraform-with-aws-day1-why-terraform-matters-how-it-really-works-h81</link>
      <guid>https://dev.to/amitsinghs98/terraform-with-aws-day1-why-terraform-matters-how-it-really-works-h81</guid>
      <description>&lt;h2&gt;
  
  
  What Is Infrastructure as Code (IaC)?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Infrastructure as Code (IaC) means you write code to create and manage your cloud infrastructure.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Infrastructure as Code simply means:&lt;/p&gt;

&lt;p&gt;Using code to create and manage cloud resources&lt;br&gt;
instead of clicking buttons on the cloud console.&lt;/p&gt;

&lt;p&gt;Normally, to create a server or a database on AWS, you open the console and click through 10–20 screens. With IaC, you just write something like:&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;code&gt;resource "aws_instance" "demo" {&lt;br&gt;
  ami           = "ami-12345"&lt;br&gt;
  instance_type = "t2.micro"&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why IaC approach is good to go:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Repeatable&lt;br&gt;
Consistent&lt;br&gt;
Version-controlled&lt;br&gt;
Automated&lt;br&gt;
Error-free&lt;br&gt;
Team-friendly&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And this is exactly the reason DevOps engineers love IaC.&lt;/p&gt;
&lt;h2&gt;
  
  
  Tools Used for IaC
&lt;/h2&gt;

&lt;p&gt;You’ll find many IaC tools out there, but they fall into two categories:&lt;/p&gt;
&lt;h2&gt;
  
  
  Multi-Cloud Tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Terraform ⭐ (most popular)&lt;/li&gt;
&lt;li&gt;Pulumi&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Cloud-Specific Tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AWS CloudFormation, CDK, SAM&lt;/li&gt;
&lt;li&gt;Azure ARM, Bicep&lt;/li&gt;
&lt;li&gt;GCP Deployment Manager
Terraform is universal, meaning it works with AWS, Azure, GCP, Kubernetes, and dozens of other platforms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why almost every DevOps roadmap begins with Terraform.&lt;/p&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/s5fwSG_00P8"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do We Even Need Terraform?
&lt;/h2&gt;

&lt;p&gt;Good question — because AWS already gives us a beautiful console, right?&lt;br&gt;
So why write code?&lt;/p&gt;

&lt;p&gt;To understand this, let’s imagine a very common architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem:&lt;/strong&gt; Manual Infrastructure Doesn’t Scale&lt;br&gt;
Let’s consider a simple 3-tier application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web tier&lt;/li&gt;
&lt;li&gt;App tier&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Database tier&lt;br&gt;
To deploy this, you need to create:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPC&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Subnets&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EC2 instances&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto Scaling Groups&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Load Balancers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RDS Database&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Route 53&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Security groups&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And more…&lt;br&gt;
👉 Doing this manually takes ~2 hours per environment&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now multiply that:&lt;br&gt;
&lt;strong&gt;1 Application = 6 environments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(dev, staging, prod)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 hours × 6 = 12 hours per app&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And in real companies?&lt;/p&gt;

&lt;p&gt;They don’t run 1 or 2 apps.&lt;br&gt;
They run hundreds.&lt;/p&gt;

&lt;p&gt;This makes manual provisioning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time-consuming&lt;/li&gt;
&lt;li&gt;Expensive&lt;/li&gt;
&lt;li&gt;Error-prone&lt;/li&gt;
&lt;li&gt;Inconsistent&lt;/li&gt;
&lt;li&gt;Impossible to track&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s break down the real-world issues 👇&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges of Manual Cloud Provisioning
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Too slow&lt;br&gt;
Teams wait for infrastructure → delayed releases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Too many people required&lt;br&gt;
Hiring a large infra team = huge cost.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Too many human errors&lt;br&gt;
Wrong AMI, wrong subnet, wrong IP → outages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No consistency&lt;br&gt;
Dev ≠ Staging ≠ Prod&lt;br&gt;
This leads to the classic:&lt;br&gt;
“It works on my machine!”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No version control&lt;br&gt;
No history, no audit, no rollback.&lt;br&gt;
This is where Terraform shines.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Terraform: The Ultimate Solution
&lt;/h2&gt;

&lt;p&gt;Terraform allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write infrastructure code once&lt;/li&gt;
&lt;li&gt;Reuse it for any number of environments&lt;/li&gt;
&lt;li&gt;Keep everything consistent&lt;/li&gt;
&lt;li&gt;Automate deployments&lt;/li&gt;
&lt;li&gt;Eliminate human errors&lt;/li&gt;
&lt;li&gt;Track all changes through Git&lt;/li&gt;
&lt;li&gt;Destroy environments automatically to save cost
And all this with just a few .tf files. Terraform brings speed, safety, repeatability, and control to cloud infrastructure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Terraform Actually Works
&lt;/h2&gt;

&lt;p&gt;Terraform uses a declarative language called HCL (HashiCorp Configuration Language).&lt;br&gt;
You write.tf files to describe what you want.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;code&gt;resource "aws_vpc" "main" {&lt;br&gt;
  cidr_block = "10.0.0.0/16"&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;Then you run 4 important commands:&lt;/p&gt;

&lt;p&gt;terraform init&lt;/p&gt;

&lt;p&gt;Downloads the provider plugins (like AWS provider).&lt;br&gt;
This is always the first command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;terraform validate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Checks if your Terraform files are correct syntactically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;terraform plan&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shows a preview of:&lt;/p&gt;

&lt;p&gt;what Terraform will create&lt;br&gt;
what it will modify&lt;br&gt;
what it will delete&lt;br&gt;
This is like a “safety check” before deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;terraform apply&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Actually creates infrastructure in AWS via API calls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;terraform destroy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Removes everything mentioned in your .tf files. Removes all resources defined in your Terraform project.&lt;br&gt;
Useful for dev/testing environments.&lt;/p&gt;




&lt;h2&gt;
  
  
  Terraform + Git = Pure Magic
&lt;/h2&gt;

&lt;p&gt;Using Git with Terraform gives you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full version history&lt;/li&gt;
&lt;li&gt;Rollbacks&lt;/li&gt;
&lt;li&gt;Pull request approvals&lt;/li&gt;
&lt;li&gt;Collaboration&lt;/li&gt;
&lt;li&gt;Faster Approval&lt;/li&gt;
&lt;li&gt;CI/CD automation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Infrastructure becomes predictable, secure, and auditable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Terraform (Quick Summary)
&lt;/h2&gt;

&lt;p&gt;Install using Homebrew / apt / yum / Chocolatey&lt;br&gt;
Confirm using:&lt;br&gt;
terraform version&lt;br&gt;
Install VS Code extension → HashiCorp Terraform&lt;br&gt;
Set alias tf=terraform for easy typing&lt;br&gt;
You’re ready to start!&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>aws</category>
    </item>
    <item>
      <title>Starting My 30 Days of Terraform (AWS Edition) – From Basics to Advanced Projects</title>
      <dc:creator>Amit Singh Deora</dc:creator>
      <pubDate>Wed, 01 Oct 2025 10:04:31 +0000</pubDate>
      <link>https://dev.to/amitsinghs98/starting-my-30-days-of-terraform-aws-edition-from-basics-to-advanced-projects-1flj</link>
      <guid>https://dev.to/amitsinghs98/starting-my-30-days-of-terraform-aws-edition-from-basics-to-advanced-projects-1flj</guid>
      <description>&lt;p&gt;Hey folks,&lt;br&gt;
I’ve decided to kick off a 𝟯𝟬-𝗱𝗮𝘆 𝗧𝗲𝗿𝗿𝗮𝗳𝗼𝗿𝗺 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲 where I’ll be learning, practicing, and sharing everything from the fundamentals to advanced AWS projects.&lt;/p&gt;

&lt;p&gt;The goal isn’t just to get comfortable writing Terraform, but also to understand how it’s applied in real-world infrastructure—building things that are scalable, reusable, and production-ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to expect
&lt;/h2&gt;

&lt;p&gt;• Starting with the 𝗯𝗮𝘀𝗶𝗰𝘀 𝗼𝗳 𝗧𝗲𝗿𝗿𝗮𝗳𝗼𝗿𝗺 and gradually leveling up&lt;br&gt;
• Working through 𝗔𝗪𝗦 𝘀𝗲𝗿𝘃𝗶𝗰𝗲𝘀 𝗮𝗻𝗱 𝘀𝗲𝘁𝘂𝗽𝘀 (VPCs, IAM, EC2, S3, RDS, EKS, etc.)&lt;br&gt;
• Diving into 𝗮𝗱𝘃𝗮𝗻𝗰𝗲𝗱 𝗧𝗲𝗿𝗿𝗮𝗳𝗼𝗿𝗺 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝘀 like modules, remote state, CI/CD integration, and infra testing&lt;br&gt;
• Wrapping it all up with 𝗽𝗿𝗼𝗷𝗲𝗰𝘁𝘀 𝘁𝗵𝗮𝘁 𝗲𝘃𝗲𝗿𝘆 𝗗𝗲𝘃𝗢𝗽𝘀/𝗖𝗹𝗼𝘂𝗱 𝗲𝗻𝗴𝗶𝗻𝗲𝗲𝗿 𝘀𝗵𝗼𝘂𝗹𝗱 𝗸𝗻𝗼𝘄&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9xx0x7v8eo39x76z7qz.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9xx0x7v8eo39x76z7qz.jpeg" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Terraform + AWS?
&lt;/h2&gt;

&lt;p&gt;Terraform is pretty much the go-to tool for infrastructure as code today, and AWS gives the perfect ecosystem to try out real-world use cases. It’s where most of us end up using it on the job anyway.&lt;/p&gt;

&lt;p&gt;Join me on this journey&lt;br&gt;
• If you’re new, this series might help you get started with a strong foundation.&lt;br&gt;
• If you’re already experienced, maybe you’ll find some practical tips—or even share a few of your own.&lt;br&gt;
• Either way, let’s learn in public together 🚀&lt;br&gt;
I’ll be posting updates here on 𝗱𝗲𝘃.𝘁𝗼 and sharing insights along the way. Hopefully, by the end of these 30 days, we’ll all have a stronger Terraform + AWS toolkit 💪.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Let’s do this! *&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>terraform</category>
    </item>
  </channel>
</rss>
