Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consul_keys do not read anything #7786

Closed
evilezh opened this issue Jul 24, 2016 · 4 comments
Closed

consul_keys do not read anything #7786

evilezh opened this issue Jul 24, 2016 · 4 comments

Comments

@evilezh
Copy link

evilezh commented Jul 24, 2016

Terraform Version

tested on 0.7.0-rc2 and 0.7.0-rc3

Affected Resource(s)

consul_keys

Terraform Configuration Files

I run this:

variable "tf_path" {
  default = "configuration/terraform/"
}

resource consul_key_prefix tf_variables {
  path_prefix = "${var.tf_path}"
  subkeys {
    region                      = "eu-west-1"
.....
}

which places key correctly in place, i can see through UI.
next code would expect to read back:

resource "consul_keys" "tf_variables" {
  key  {
    name = "region"
    path = "configuration/terraform/region"
  }
}

output v1 {
  value = "${consul_keys.tf_variables.var.region}"
}

But it gives empty string.

tfstate:
  "resources": {
                "consul_keys.tf_variables": {
                    "type": "consul_keys",
                    "primary": {
                        "id": "consul",
                        "attributes": {
                            "datacenter": "eu-west-1",
                            "id": "consul",
                            "key.#": "1",
                            "key.2639784802.default": "",
                            "key.2639784802.delete": "false",
                            "key.2639784802.name": "region",
                            "key.2639784802.path": "configuration/terraform/region",
                            "key.2639784802.value": "",
                            "var.%": "1",
                            "var.region": ""
                        },
                        "meta": {
                            "schema_version": "1"
                        }
                    }
                },

Either way ..it should be data source, rather than resource.

@apparentlymart
Copy link
Contributor

Hi @evilezh! Sorry for the trouble here.

At least for the last part about it being a data source, that's what #7678 is about, and that'll hopefully be merged before 0.7.0 final.

For the issue of it not reading back: that's a weird issue that I've not seen before, and nothing changed in my patch above that is likely to address whatever issue you had there. Those two configuration snippets are from separate Terrraform configs, right? (as opposed to different parts of the same config that would get applied by the same terraform run)

@stack72
Copy link
Contributor

stack72 commented Jul 26, 2016

Hi @evilezh / @apparentlymart

I just merged #7678 FWIW :)

P.

@stack72
Copy link
Contributor

stack72 commented Nov 2, 2016

I believe this is closed via #7678

@stack72 stack72 closed this as completed Nov 2, 2016
@ghost
Copy link

ghost commented Apr 20, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants