<?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: Anand Ghangoria</title>
    <description>The latest articles on DEV Community by Anand Ghangoria (@anand_ghangoria_125645bf4).</description>
    <link>https://dev.to/anand_ghangoria_125645bf4</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%2F2510597%2Fdf196761-50fe-4d73-b2f3-613286e4386e.jpg</url>
      <title>DEV Community: Anand Ghangoria</title>
      <link>https://dev.to/anand_ghangoria_125645bf4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anand_ghangoria_125645bf4"/>
    <language>en</language>
    <item>
      <title>Linux : Mastering File System</title>
      <dc:creator>Anand Ghangoria</dc:creator>
      <pubDate>Wed, 18 Jun 2025 13:23:14 +0000</pubDate>
      <link>https://dev.to/anand_ghangoria_125645bf4/linux-mastering-file-system-32k5</link>
      <guid>https://dev.to/anand_ghangoria_125645bf4/linux-mastering-file-system-32k5</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;What is the Linux File System?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Linux file system follows a hierarchical directory structure where everything—directories, devices, and even hardware components—is treated as a file. Unlike Windows, which organizes storage using drive letters like C: and D:, Linux operates under a unified structure with a single root directory (/) that encompasses all files and directories.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Linux File System Hierarchy&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Linux file system follows the Filesystem Hierarchy Standard (FHS), which defines a consistent structure for directories and files. Below is an overview of essential directories with examples:&lt;br&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%2F1wj2b3wui28nsv3qbp82.jpg" 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%2F1wj2b3wui28nsv3qbp82.jpg" alt="Image description" width="800" height="66"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  1. / (Root Directory)
&lt;/h4&gt;

&lt;p&gt;The top-level directory from which all other directories branch out. Only the root user has full access to modify critical system files.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists all top-level directories.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. /bin (Binary Executables)
&lt;/h4&gt;

&lt;p&gt;Contains essential system binaries (commands) like ls, cp, mv, rm, and cat.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists all essential system binaries.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. /boot (Boot Loader Files)
&lt;/h4&gt;

&lt;p&gt;Stores files needed for booting the system, including the Linux kernel (vmlinuz), bootloader configuration, and initial RAM disk (initrd).&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Displays all boot-related files.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. /dev (Device Files)
&lt;/h4&gt;

&lt;p&gt;Contains files representing hardware devices (e.g., /dev/sda for the first hard disk, /dev/tty for terminals).&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists available storage devices.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. /etc (Configuration Files)
&lt;/h4&gt;

&lt;p&gt;Stores system-wide configuration files and scripts.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Displays system user account details.&lt;/p&gt;

&lt;h4&gt;
  
  
  6. /home (User Home Directories)
&lt;/h4&gt;

&lt;p&gt;Contains personal directories for users (e.g., /home/user1, /home/user2).&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists all user directories.&lt;/p&gt;

&lt;h4&gt;
  
  
  7. /lib &amp;amp; /lib64 (Shared Libraries)
&lt;/h4&gt;

&lt;p&gt;Stores essential shared libraries required by system programs.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists shared C library files.&lt;/p&gt;

&lt;h4&gt;
  
  
  8. /media &amp;amp; /mnt (Mount Points)
&lt;/h4&gt;

&lt;p&gt;/media: Used for mounting external devices like USB drives and CDs.&lt;br&gt;
/mnt: Temporary mount point for manual mounting of filesystems.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;This mounts an external drive and lists its contents.&lt;/p&gt;

&lt;h4&gt;
  
  
  9. /opt (Optional Software)
&lt;/h4&gt;

&lt;p&gt;Contains software installed by third-party vendors.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists installed optional software.&lt;/p&gt;

&lt;h4&gt;
  
  
  10. /proc (Process Information)
&lt;/h4&gt;

&lt;p&gt;Virtual filesystem that provides information about running processes and system resources.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Displays CPU details.&lt;/p&gt;

&lt;h4&gt;
  
  
  11. /root (Root User’s Home Directory)
&lt;/h4&gt;

&lt;p&gt;Home directory for the root user.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists files in the root user's home directory.&lt;/p&gt;

&lt;h4&gt;
  
  
  12. /run (Runtime Data)
&lt;/h4&gt;

&lt;p&gt;Stores volatile runtime information like process IDs.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists runtime data files.&lt;/p&gt;

&lt;h4&gt;
  
  
  13. /sbin (System Binaries)
&lt;/h4&gt;

&lt;p&gt;Contains essential system administration commands.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;lists of administrative commands.&lt;/p&gt;

&lt;h4&gt;
  
  
  14. /srv (Service Data)
&lt;/h4&gt;

&lt;p&gt;Stores data related to services like web servers (/srv/www).&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists stored service data.&lt;/p&gt;

&lt;h4&gt;
  
  
  15. /sys (System Information)
&lt;/h4&gt;

&lt;p&gt;Virtual filesystem providing real-time access to kernel and hardware information.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists a Displays system-related files.&lt;/p&gt;

&lt;h4&gt;
  
  
  16. /tmp (Temporary Files)
&lt;/h4&gt;

&lt;p&gt;Used for storing temporary files.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists temporary files.&lt;/p&gt;

&lt;h4&gt;
  
  
  17. /usr (User Binaries and Libraries)
&lt;/h4&gt;

&lt;p&gt;Contains user applications, libraries, documentation, and source code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists user command binaries.&lt;/p&gt;

&lt;h4&gt;
  
  
  18. /var (Variable Data)
&lt;/h4&gt;

&lt;p&gt;Stores variable files like logs and caches.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example:
&lt;/h4&gt;

&lt;p&gt;Lists system logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  File Types in Linux
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Regular Files (-************************): Text, binary, and executable files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Directories (d************************): Containers that hold files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Symbolic Links (l************************): Pointers to other files.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Special Files:&lt;/p&gt;

&lt;p&gt;Character devices (c): /dev/tty&lt;/p&gt;

&lt;p&gt;Block devices (b): /dev/sda&lt;/p&gt;

&lt;p&gt;Named pipes (p), sockets (s)&lt;/p&gt;

&lt;h2&gt;
  
  
  Important Linux commands for File Operations with Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Viewing Files:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat filename
less filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Copying Files:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp source.txt destination.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Moving/Renaming Files:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv oldname.txt newname.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deleting Files:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Changing File Permissions:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 755 script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Changing File Ownership:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chown user:group filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating a Symbolic Link:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ln -s /path/to/file linkname
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Finding Files:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find / -name "file.txt"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Checking Disk Usage:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Terraform Made Easy: A Hands-On Introduction for Beginners</title>
      <dc:creator>Anand Ghangoria</dc:creator>
      <pubDate>Sat, 24 May 2025 11:09:54 +0000</pubDate>
      <link>https://dev.to/anand_ghangoria_125645bf4/terraform-made-easy-a-hands-on-introduction-for-beginners-fl</link>
      <guid>https://dev.to/anand_ghangoria_125645bf4/terraform-made-easy-a-hands-on-introduction-for-beginners-fl</guid>
      <description>&lt;p&gt;This article provides a professional introduction to Terraform, outlining its core features, workflow, and significance in modern DevOps practices. We’ll explore common use cases relevant to various environments and highlight initial challenges to help streamline your adoption of Terraform. Let’s get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  History of Terraform
&lt;/h3&gt;

&lt;p&gt;The inventor of terraform is Mitchell Hashimoto, the co-founder of Hashicrop.&lt;/p&gt;

&lt;p&gt;It was designed as an infrastructure as code (IaC) tool to help automate cloud infrastructure provisioning.&lt;br&gt;
2014: Initial release by Hashicrop.&lt;br&gt;
2017: Introduction of HCL(Hashicrop Configuration Language)&lt;br&gt;
2021: Terraform 1.0 released, as stable for production use.&lt;br&gt;
2023: Opensource ---&amp;gt; Bussiness Source License (BSL).&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Infrastructure as Code (IaC)?
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code (IaC) is a method of managing and setting up IT infrastructure using code, instead of manually configuring hardware or using point-and-click tools. With IaC, you write configuration files that tell the system what resources to create, making the process faster, repeatable, and more reliable.&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%2Fpi04vh6s8hfybj94eza0.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%2Fpi04vh6s8hfybj94eza0.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The image above illustrates how traditional infrastructure operates.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Terraform?
&lt;/h2&gt;

&lt;p&gt;Terraform helps organizations reduce manual work, improve efficiency, and maintain infra-structure consistency across different environment.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Terraform?
&lt;/h2&gt;

&lt;p&gt;Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp. It allows you to define, provision, and manage cloud infrastructure using simple, human-readable configuration files written in HashiCorp Configuration Language (HCL).&lt;/p&gt;

&lt;p&gt;Seamlessly integrating with CI/CD pipelines, Terraform automates infrastructure provisioning and changes, streamlining development workflows and ensuring repeatability across environments.&lt;/p&gt;
&lt;h3&gt;
  
  
  Key Terraform components
&lt;/h3&gt;

&lt;p&gt;Terraform is stateful, tracking the state of the infrastructure by comparing the current defined IaC configuration and a state file it generates after a Terraform run. This introduces a layer of complexity because you need to manage this state file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Providers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define which platform or service you're interacting with (e.g., AWS, Azure, GCP, Kubernetes).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&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;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Represent the infrastructure objects you want to create or manage (e.g., EC2 instances, S3 buckets).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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_instance" "web" { ... }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Modules&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Group multiple resources together for reuse and organization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Help you follow DRY (Don't Repeat Yourself) principles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example: A reusable VPC module used across environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Variables&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Allow you to customize configurations without changing the code.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;variable "instance_type" { default = "t2.micro" }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Show useful information after a Terraform run (e.g., IP address of a created instance).&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;output "instance_ip" { value = aws_instance.web.public_ip }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;State&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Tracks the current state of your infrastructure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;State stored in a .tfstate file, either locally or remotely (e.g., in S3).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Terraform follows a simple yet powerful workflow to manage infrastructure as code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Init&lt;/strong&gt; – Run &lt;code&gt;terraform init&lt;/code&gt; to initialize the working directory and download providers.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan&lt;/strong&gt; – Preview changes with &lt;code&gt;terraform plan&lt;/code&gt; before making any updates.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply&lt;/strong&gt; – Execute changes with &lt;code&gt;terraform apply&lt;/code&gt; to provision or update resources.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destroy&lt;/strong&gt; – Use &lt;code&gt;terraform destroy&lt;/code&gt;, to Destroys all resources defined in your Terraform configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🔍 File Overview
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;main.tf&lt;/code&gt;&lt;/strong&gt; – The heart of your infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;variables.tf&lt;/code&gt;&lt;/strong&gt; – Defines inputs for flexibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;terraform.tfvars&lt;/code&gt;&lt;/strong&gt; – Assigns real values to your variables.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;outputs.tf&lt;/code&gt;&lt;/strong&gt; – Makes key info accessible after deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;provider.tf&lt;/code&gt;&lt;/strong&gt; – Sets up your cloud provider (e.g., AWS).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;backend.tf&lt;/code&gt;&lt;/strong&gt; – Configures remote state storage (optional but recommended).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;versions.tf&lt;/code&gt;&lt;/strong&gt; – Locks Terraform &amp;amp; provider versions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;modules/&lt;/code&gt;&lt;/strong&gt; – Reusable infrastructure components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;env/&lt;/code&gt;&lt;/strong&gt; – Isolated configurations for environments like dev/staging/prod.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📦 &lt;em&gt;Pro Tip:&lt;/em&gt; Keep sensitive values (like secrets) out of version control. Use &lt;code&gt;terraform.tfvars&lt;/code&gt; locally or manage secrets with tools like Vault or SSM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hashicrop Configuration Language (HCL)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is HCL?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HCL (HashiCorp Configuration Language)&lt;/strong&gt; is a &lt;strong&gt;declarative language&lt;/strong&gt; designed by HashiCorp.&lt;br&gt;&lt;br&gt;
It is mainly used in tools like &lt;strong&gt;Terraform&lt;/strong&gt; to define &lt;strong&gt;Infrastructure as Code (IaC)&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Human-readable:&lt;/strong&gt; Easy for people to write and understand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Declarative:&lt;/strong&gt; You describe &lt;em&gt;what&lt;/em&gt; you want, not &lt;em&gt;how&lt;/em&gt; to do it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimized for machines:&lt;/strong&gt; Easy for software to parse and process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HCL allows you to manage and provision cloud resources (like AWS, Azure, GCP) in a clear and structured way.&lt;/p&gt;
&lt;h3&gt;
  
  
  HCL Syntax: Blocks, Parameters, and Arguments
&lt;/h3&gt;
&lt;h4&gt;
  
  
  1. &lt;strong&gt;Blocks&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Blocks are the fundamental building units in HCL. They group configuration settings together.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A block starts with a &lt;strong&gt;block type&lt;/strong&gt; (like &lt;code&gt;resource&lt;/code&gt;, &lt;code&gt;provider&lt;/code&gt;, &lt;code&gt;variable&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;It can have one or more &lt;strong&gt;labels&lt;/strong&gt; (names or identifiers).&lt;/li&gt;
&lt;li&gt;Inside the curly braces &lt;code&gt;{}&lt;/code&gt;, you write the block’s &lt;strong&gt;body&lt;/strong&gt; — parameters and arguments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_instance"&lt;/span&gt; &lt;span class="s2"&gt;"web_server"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ami-0c55b159cbfafe1f0"&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t2.micro"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;resource is the block type&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"aws_instance" and "web_server" are labels (resource type and resource name)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inside {}, you define arguments (parameters to configure the resource)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. &lt;strong&gt;Arguments&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Arguments are &lt;strong&gt;key-value pairs&lt;/strong&gt; inside a block that configure the block’s behavior.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;key&lt;/strong&gt; is the argument name.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;value&lt;/strong&gt; can be a string, number, boolean, list, map, or an expression.&lt;/li&gt;
&lt;li&gt;Arguments define &lt;strong&gt;how&lt;/strong&gt; a resource, provider, or variable is set up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_instance"&lt;/span&gt; &lt;span class="s2"&gt;"example"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ami-0c55b159cbfafe1f0"&lt;/span&gt;  &lt;span class="c1"&gt;# Argument&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t2.micro"&lt;/span&gt;                 &lt;span class="c1"&gt;# Argument&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;These two lines are arguments specifying which Amazon Machine Image (AMI) to use and the instance size.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. &lt;strong&gt;Parameters&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Parameters&lt;/strong&gt; are inputs that allow you to customize and reuse your Terraform configurations, especially within &lt;strong&gt;variables&lt;/strong&gt; and &lt;strong&gt;modules&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parameters define what values a block (like &lt;code&gt;variable&lt;/code&gt; or &lt;code&gt;module&lt;/code&gt;) expects from the user.&lt;/li&gt;
&lt;li&gt;They make your configurations flexible by accepting dynamic input.&lt;/li&gt;
&lt;li&gt;Parameters are declared inside blocks like &lt;code&gt;variable&lt;/code&gt; or passed into &lt;code&gt;module&lt;/code&gt; blocks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"region"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"The AWS region where resources will be created"&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
  &lt;span class="nx"&gt;default&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;In this example, description, type, and default are parameters (arguments) that define the variable’s behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hands-On: Provisioning an S3 Bucket with Terraform
&lt;/h3&gt;

&lt;p&gt;In this hands-on guide, we'll walk through the steps to create an Amazon S3 bucket using Terraform. This is perfect for beginners who want to get practical experience with Infrastructure as Code (IaC) on AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Verify Terraform and AWS CLI Versions
&lt;/h3&gt;

&lt;p&gt;Before starting, make sure both Terraform and AWS CLI are installed and accessible in your terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform &lt;span class="nt"&gt;-version&lt;/span&gt;
aws &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Define the AWS Provider Configuration
&lt;/h3&gt;

&lt;p&gt;Create a file named &lt;code&gt;provider.tf&lt;/code&gt; and configure the AWS provider. This tells Terraform which cloud and region to use.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Make sure you’ve configured AWS CLI with your credentials using &lt;code&gt;aws configure&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Configure &lt;code&gt;main.tf&lt;/code&gt; for S3 Bucket
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Now create the main Terraform configuration to define the S3 bucket resource.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# main.tf
resource "aws_s3_bucket" "my_bucket" {
  bucket = "anand-ghangoria-bucket"  # Replace with a unique name

  tags = {
    Name        = "MyBucket"
    Environment = "Dev"
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Bucket names must be globally unique across all AWS accounts. Modify bucket accordingly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Initialize, Plan, and Apply
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Run the following Terraform commands in the terminal:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Initialize the project (downloads provider plugins)
terraform init

# Preview the changes that will be made
terraform plan

# Apply the configuration to create the S3 bucket
terraform apply

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When prompted, type yes to confirm the apply step.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If everything was configured correctly, you should see an output like:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ve now successfully created an S3 bucket using Terraform!&lt;/p&gt;

&lt;h3&gt;
  
  
  STEP:5 Clean Up Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To delete the S3 bucket and avoid unwanted charges:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform destroy

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Hands-On: create an EC2 instance on AWS using Terraform
&lt;/h3&gt;

&lt;p&gt;In this hands-on guide, we'll walk through the steps to create an Amazon EC2 instance using Terraform. This is perfect for beginners who want to get practical experience with Infrastructure as Code (IaC) on AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Verify Terraform and AWS CLI Versions
&lt;/h3&gt;

&lt;p&gt;Before starting, make sure both Terraform and AWS CLI are installed and accessible in your terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraform &lt;span class="nt"&gt;-version&lt;/span&gt;
aws &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Define the AWS Provider Configuration
&lt;/h3&gt;

&lt;p&gt;Create a file named &lt;code&gt;provider.tf&lt;/code&gt; and configure the AWS provider. This tells Terraform which cloud and region to use.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Make sure you’ve configured AWS CLI with your credentials using &lt;code&gt;aws configure&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Configure &lt;code&gt;main.tf&lt;/code&gt; for EC2 instance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Now create the main Terraform configuration to define the EC2 instance resource .
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# main.tf
resource "aws_key_pair" "my_key" {
  key_name   = "delight"
  public_key = file("delight.pub")
}

data "aws_ami" "ubuntu" {
  most_recent = true

  filter {
    name   = "name"
    values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
  }

  filter {
    name   = "virtualization-type"
    values = ["hvm"]
  }

  owners = ["099720109477"] # Canonical
}

resource "aws_instance" "web" {
  ami           = data.aws_ami.ubuntu.id
  instance_type = "t2.micro"
  key_name = aws_key_pair.my_key.key_name

  tags = {
    Name = "delight"
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4:Generate an SSH key pair named &lt;code&gt;delight&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t rsa -b 2048 -f delight
chmod 400 delight


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;When prompted for a passphrase, you can just press Enter to skip it (or set one if you want).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 5: Initialize, Plan, and Apply
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Run the following Terraform commands in the terminal:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Initialize the project (downloads provider plugins)
terraform init

# Preview the changes that will be made
terraform plan

# Apply the configuration to create the S3 bucket
terraform apply

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When prompted, type yes to confirm the apply step.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If everything was configured correctly, you should see an output like:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ve now successfully created an ec2 instance using Terraform!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step:6 Clean Up Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To delete the ec2 instace and avoid unwanted charges:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform destroy

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Terraform #IaC #FileStructure #DevOps #BestPractices #HashiCorp #CloudInfrastructure
&lt;/h1&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>cloud</category>
      <category>terraform</category>
    </item>
  </channel>
</rss>
