Skip to main content

Syntax

The majority of the OpenTF language documentation focuses on the practical uses of the language and the specific constructs it uses. The pages in this section offer a more abstract view of the OpenTF language.

  • Configuration Syntax describes the native grammar of the OpenTF language.
  • JSON Configuration Syntax documents how to represent OpenTF language constructs in the pure JSON variant of the OpenTF language. OpenTF's JSON syntax is unfriendly to humans, but can be very useful when generating infrastructure as code with other systems that don't have a readily available HCL library.
  • Style Conventions documents some commonly accepted formatting guidelines for OpenTF code. These conventions can be enforced automatically with opentf fmt.