[Terraform] HCL Basic

LizzyLee·2024년 10월 17일

Syntax 를 공부해보자!

Understanding Terraform Blocks, Arguments, and Identifiers

1. Blocks in Terraform

  • Blocks represent specific types like resource, variable, and output.
  • Blocks can be simple or nested inside another block.

2. Arguments

  • Arguments are used within a block to assign values to specific names.
  • Some arguments are mandatory, while others are optional.

3. Identifiers

  • Identifiers represent the names of arguments, block types, or other Terraform constructs.
  • Identifiers can include letters, underscores, hyphens, and digits but cannot start with a digit.

4. Expressions

  • Expressions are used to assign values to identifiers within a block.
  • Expressions can be simple or complex.

5. Comments

  • A single-line comment starts with a # symbol.

6. HCL (HashiCorp Configuration Language)

  • HCL is declarative, meaning you define the desired end state of infrastructure.
  • The order of blocks or files does not matter.

0개의 댓글