No description
  • Go 90.8%
  • HCL 3.9%
  • Lua 3.7%
  • Shell 1.6%
Find a file
Christian Mesh 670153f06c
Merge pull request #5 from opentofu/4_fix_list_and_null_encoding
Fix null/list encoding + example
2025-02-24 14:39:54 -05:00
.github/workflows Move release.yml to correct location 2024-04-18 11:01:41 -04:00
.gitignore Added release process 2024-04-18 15:59:03 +01:00
.goreleaser.yml Added release process 2024-04-18 15:59:03 +01:00
go.mod Initial hacked together prototype for configured functions 2024-04-17 13:04:11 -04:00
go.sum Initial hacked together prototype for configured functions 2024-04-17 13:04:11 -04:00
lib.lua Fix null/list encoding + example 2025-01-13 17:46:45 -05:00
LICENSE Relicense to MPL per organization policies 2024-04-22 07:35:14 -04:00
main.go Fix null/list encoding + example 2025-01-13 17:46:45 -05:00
main.lua Split main and library example 2024-04-17 13:09:40 -04:00
main.tf Fix null/list encoding + example 2025-01-13 17:46:45 -05:00
README.md Clarify experimental 2024-04-18 12:18:59 -04:00
terraform-registry-manifest.json Added release process 2024-04-18 15:59:03 +01:00
test.sh Initial hacked together prototype for configured functions 2024-04-17 13:04:11 -04:00

terraform-provider-lua

This is an experimental OpenTofu and Terraform function provider based on terraform-plugin-go.

It provides an "exec" function which takes a lua program as the first parameter and passes all additional parameters to the function defined in the lua file.

locals {
    lua_echo = <<EOT

function echo( input )
    return input
end

return echo

EOT
}

output "example" {
    value = provider::lua::exec(local.lua_echo, {"foo": {"bar": 42}})
}

In OpenTofu 1.7.0-beta1 you may configure the provider and pass it a lua library to load. Any functions exposed in this library will be available as functions within the tofu configuration. This feature is an experimental preview and is subject to change before the OpenTofu 1.7.0 release.

provider "lua" {
    lua = file("./lib.lua")
}

output "example" {
    value = provider::lua::echo({"message": "Hello Functions!"})
}