DevOps
  • 🏁Roadmap
  • PRE-REQUISITE
    • Glossary
    • Linux
    • Networking
    • Server
    • Databases
    • Security
  • FUNDAMENTALS
    • 12 Factors
    • GIT
    • Shell Scripts
    • JSON/YAML
    • Python
    • Golang
    • Packaging
  • DEVOPS TOOLS
    • Docker
    • Terraform
      • Module
      • HCL Syntax
      • State
      • .tf file
    • Ansible
    • Chef
    • Kubernete
    • ArgoCD
    • Chef
    • Puppet
    • Prometheus
  • PoC
    • USE CASES
Powered by GitBook
On this page
  • Block
  • Block syntax
  • Type of block
  • Basic syntax
  • Comment
  1. DEVOPS TOOLS
  2. Terraform

HCL Syntax

Block

Block syntax

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

Type of block

resource and data block

Basic syntax

# argument
image_id = "abc123"

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

Comment

using //

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

Last updated 1 year ago