Skip to content

Support for Terraform 1.8 Provider Functions #1014

@okautz

Description

@okautz

Support for Terraform 1.8 Provider Functions

Hello!

When using provider functions that were introduced with Terraform 1.8, it is not possible to parse *.tf files containing those function invocations.

How to reproduce

When using a provider functions like in this example:

# test.tf
terraform {
  required_providers {
    local = {
      source = "hashicorp/local"
    }
  }
  required_version = ">= 1.8.0"
}

output "example_output" {
  value = provider::local::direxists("${path.module}/test")
}

Leading to

$ conftest parse test.tf
Error: parse configurations: parser unmarshal: convert to bytes: parse config: [:11,19-20: Missing newline after argument; An argument definition must end with a newline.], path: test.tf

Context

It seems that support for those provider function was added in hcl/v2 >= v2.20.1. As far as I can see, conftest uses v2.17.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions