> For the complete documentation index, see [llms.txt](https://mamawhocode.gitbook.io/devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mamawhocode.gitbook.io/devops/devops-tools/terraform/hcl-syntax.md).

# HCL Syntax

## Block

### Block syntax

```hcl
<BLOCK TYPE> "<BLOCK LABEL>" "<BLOCK LABEL>" {
  # Block body
  <IDENTIFIER> = <EXPRESSION> # Argument
}
```

### Type of block

#### resource and data block

## Basic syntax

```hcl
# argument
image_id = "abc123"

# block
resource "aws_instance" "example" {
  ami = "abc123"
  network_interface {
    # ...
  }
}
```

### Comment

using <mark style="background-color:red;">//</mark>

```hcl
{
  "resource": {
    "aws_instance": {
      "example": {
        "//": "This instance runs the scheduled tasks for backup",
        "instance_type": "t2.micro",
        "ami": "ami-abc123"
      }
    }
  }
}

```
