Terraform: unknown resource 'ignition_user.core' referenced in variable ignition_user.core.id

Created on 27 Mar 2017  ยท  4Comments  ยท  Source: hashicorp/terraform

Terraform Version

Terraform v0.9.2-dev (9210222f3ca8157e429f9dc17865df8f61cbb936+CHANGES)
(but also in 0.9.1)

Affected Resource(s)

  • ignition_user
  • ignition_config

Terraform Configuration Files

data "ignition_user" "core" {
    name = "core"
    ssh_authorized_keys = "${var.ssh_key}"
}

data "ignition_config" "worker" {
    users = [
        "${ignition_user.core.id}",
    ]
}

Debug Output

https://gist.github.com/jangrewe/e3ad43638b540ec16d91a7fbdd7d29cf

Expected Behavior

An Ignition config with the user core and their SSH key should have been created.

Actual Behavior

1 error(s) occurred:

* module root: 
  module kubernetes.root: 1 error(s) occurred:

* resource 'data.ignition_config.worker' config: unknown resource 'ignition_user.core' referenced in variable ignition_user.core.id

Steps to Reproduce

  1. terraform plan
provideignition

Most helpful comment

Ouch, thanks @grubernaut - i think my copy & pasting is broken :stuck_out_tongue_winking_eye:

All 4 comments

If i use the Ignition provider as a resource instead of as a data source, it seems to work, but with a warning:

Warnings:

  * module.kubernetes.ignition_user.core: using ignition_user as a resource is deprecated; consider using the data source instead

Is the documentation too far ahead (only data source mentioned), and the code also a little bit behind (resource deprecated without data source being implemented)?

Maybe @mcuadros has an idea what's going on? It's probably related to https://github.com/hashicorp/terraform/pull/11851

Hi @jangrewe, thanks for the issue!

Using exports from a data source need to be specified with the following form: data.TYPE.NAME.ATTR, as documented here: https://www.terraform.io/docs/configuration/data-sources.html

If you change the reference variable to be data.ignition_user.core.id, does that solve the issue for you?

Ouch, thanks @grubernaut - i think my copy & pasting is broken :stuck_out_tongue_winking_eye:

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings