terramate-io/terramate

[FEATURE] Support for Terraform functions

Closed this issue · 2 comments

Currently Terramate supports all functions available up to Terraform 1.5.3. It could be useful to support Terraform functions available in Terraform > 1.5.3 An example is strcontains: https://developer.hashicorp.com/terraform/language/v1.5.x/functions/strcontains

i4ki commented

Small correction: Terramate supports all functions up to Terraform v0.15.3.

Thanks for this feature request, it makes sense and we are checking the options.
The problem is that v0.15.3 was the latest Terraform version with those functions exported, after this one they put them behind an internal package, which is impossible to import.
The Opentofu maintainers are not interested in solving this problem in the near future also, see the issues below:

It seems we will have to fork the latest MPL version of Terraform (v1.5.5) or fork Opentofu or implement all the functions ourselves. It would be more convenient for our users if we reused their code, because we want the exact same experience but unfortunately, this is not possible atm.

i4ki commented

We added support for OpenTofu v1.8 functions in the Terramate Release v0.10.3.

The list of functions below are now available:

  • tm_strcontains(string, substr).
  • tm_startswith(string, prefix).
  • tm_endswith(string, suffix).
  • tm_timecmp(t1, t2).
  • tm_cidrcontains(cidr, IP)

I'm closing this now but feel free to reopen if you think any improvement is still needed in this regard.
Thanks for raising this!