# 📘  Terraform Series – Day 3

### Terraform Blocks, Labels, and Arguments

In Day 2, we installed Terraform.  
Now, before writing real infrastructure code, we must understand **how Terraform actually reads and executes configurations**.

👉 Every Terraform file is built using 3 core concepts:

*   Blocks
    
*   Labels
    
*   Arguments
    

### 🔹 1. What is a Block?

👉 A block is the **main building unit** in Terraform used to define infrastructure or configuration.

📌 Example:

```shell
resource "aws_instance" "my_vm" {
}
```

👉 Meaning:

*   Block tells Terraform **what you want to create**
    

📌 Common blocks:

*   `resource`
    
*   `provider`
    
*   `variable`
    
*   `output`
    

### 🔹 2. What are Labels?

👉 Labels are **identifiers of a block** that define resource type and name.

📌 Example:

```shell
resource "aws_instance" "my_vm" {
}
```

👉 Meaning:

*   `aws_instance` → resource type
    
*   `my_vm` → resource name
    

👉 Used to uniquely identify resources

### 🔹 3. What are Arguments?

👉 Arguments are **key-value pairs inside a block** used to configure the resource.

📌 Example:

```shell
instance_type = "t2.micro"
```

👉 Meaning:

*   Defines how the resource should be created
    
*   Controls behavior and properties
    

<mark class="bg-yellow-200 dark:bg-yellow-500/30">🔗 Combined Example</mark>

```shell
resource "aws_instance" "my_vm" {
  instance_type = "t2.micro"
}
```

👉 Breakdown:

*   Block → `resource`
    
*   Labels → `aws_instance`, `my_vm`
    
*   Argument → `instance_type`
    

## **👨‍💻 About the Author**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1751797710818/123a7231-3dca-4273-ad68-7bd026f69b95.png?auto=compress,format&format=webp&auto=compress,format&format=webp&auto=compress,format&format=webp&auto=compress,format&format=webp&auto=compress,format&format=webp align="center")

“A complete Terraform series covering everything from fundamentals to advanced real-world infrastructure automation in a DevOps environment.”

### **📬 Let's Stay Connected**

*   📧 **Email**: [**gujjarapurv181@gmail.com**](mailto:gujjarapurv181@gmail.com)
    
*   🐙 **GitHub**: [**github.com/ApurvGujjar07**](http://github.com/ApurvGujjar07)
    
*   💼 **LinkedIn**: [**linkedin.com/in/apurv-gujjar**](http://linkedin.com/in/apurv-gujjar)
