chriskuchin / terraform-provider-hiera5

MIT License
10 stars 3 forks source link

lookup returned invalid JSON: '' #14

Closed jeffery closed 2 years ago

jeffery commented 2 years ago

Hi there,

I have tried the example configuration in heira5/test-fixtures directory but I keep getting the following error when using the example data

│ Error: key 'aws_tags''s lookup returned invalid JSON: ''
│
│   with data.hiera5_hash.aws_tags,
│   on main.tf line 24, in data "hiera5_hash" "aws_tags":
│   24: data "hiera5_hash" "aws_tags" {

And the terraform code for this test is shown below:

terraform {
  required_providers {
    hiera5 = {
      source = "chriskuchin/hiera5"
      version = "~> 0.2"
    }
  }
}

provider "hiera5" {
  # Optional
  config = "~/hiera.yaml"
  # Optional
  scope = {
    environment = "live"
    service     = "api"
    # Complex variables are supported using pdialect
    facts       = "{timezone=>'CET'}"
  }
  # Optional
  merge  = "deep"
}

data "hiera5_hash" "aws_tags" {
  key = "aws_tags"
}

What am I doing wrong?

terraform version
Terraform v1.1.8
on darwin_amd64
+ provider registry.terraform.io/chriskuchin/hiera5 v0.2.6
jeffery commented 2 years ago

ah found my problem, fixed it in the provider

config = "hiera.yaml"