العودة إلى الدورة

دوال HCL: السحر المدمج

احتراف البنية التحتية كبرمجيات (Terraform & OpenTofu)

Manipulating Data

OpenTofu includes built-in functions to transform data. You can't write your own functions, but the ones provided are powerful.

  • upper("hello") -> "HELLO"
  • lookup({a="1", b="2"}, "a", "0") -> "1"
  • file("${path.module}/hello.txt") -> Reads the file content.

Try it out using the command tofu console to test functions in real-time.