hashicorp / terraform-provider-ignition

Terraform Ignition provider
https://www.terraform.io/docs/providers/ignition/
Mozilla Public License 2.0
39 stars 64 forks source link

Invalid JSON when upgrading from 1.1.0 to 1.2.0 #62

Closed dstockton closed 4 years ago

dstockton commented 4 years ago
Error: Error refreshing state: 1 error occurred:
    * data.ignition_config.xxx_ignition: 1 error occurred:
    * : data.ignition_config.xxx_ignition: No valid JSON found, make sure you're using .rendered and not .id: invalid character 'c' after top-level value
seh commented 4 years ago

This is due to #56 changing the schema, such that aggregates no longer refer to the composed pieces by ID, but rather as JSON fragments. In short, as the error message says, any place you were referring to the "id" attribute of an Ignition data source, refer instead to its "rendered" attribute.

dstockton commented 4 years ago

I am already referring by rendered :(

seh commented 4 years ago

Ah, well, in that case, perhaps you can share a few fragments of your configuration so that we can help diagnose what's now going wrong. It looks like we're winding up trying to consume invalid JSON, so maybe we're feeding the wrong value in the wrong place.

dstockton commented 4 years ago

This was my misunderstanding... because the error was referencing this resource...

resource "google_compute_instance_template" "foo" {
  ...
  metadata {
    user-data = "${data.ignition_config.foo_ignition.rendered}"
  }
  ...
}

but actually the problem is with the definition of the foo_ignition resource itself 🤦‍♂. I just tried it and it works fine with 1.2. Thanks for your replies & patience!!