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

Resource consul_key_prefix does not honor datacenter set in provider consul #14451

Closed
amanjeev opened this issue May 12, 2017 · 1 comment
Closed

Comments

@amanjeev
Copy link

amanjeev commented May 12, 2017

The documentation at https://www.terraform.io/docs/providers/consul/r/key_prefix.html says that datacenter is option and that it by default uses from the provider setup. But that was not true in our case.

Terraform Version

v0.9.3

Affected Resource(s)

Please list the resources as a list, for example:

  • consul_key_prefix

Terraform Configuration Files

Provider:

variable "consul_dc" {}
variable "consul_acl_token" {}

provider "consul" {
  datacenter = "${var.consul_dc}"
  token = "${var.consul_acl_token}"
}
module "dtabs"  { source = "modules/dtabs"  dc = "${var.consul_dc}" }

Resource (without datacenter) original:

resource "consul_key_prefix" "keys" {
  path_prefix = "${var.prefix}${var.path}"
  subkeys = "${data.external.dtabs_keys.result}"
}

Resource (with datacenter) modified/fixed:

resource "consul_key_prefix" "keys" {
  datacenter = "${var.dc}" 
  path_prefix = "${var.prefix}${var.path}"
  subkeys = "${data.external.dtabs_keys.result}"
}

Expected Behavior

Since datacenter is already passed in via provider "consul", it should have chosen the correct datacenter.

Actual Behavior

It chose the wrong datacenter.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Use "Resource (without datacenter) original" resource above
  2. terraform apply
@amanjeev amanjeev changed the title Resource consul_key_prefix does not honor datacenter set in provider "consul Resource "consul_key_prefix" does not honor datacenter set in provider "consul" May 12, 2017
@amanjeev amanjeev changed the title Resource "consul_key_prefix" does not honor datacenter set in provider "consul" Resource consul_key_prefix does not honor datacenter set in provider consul May 12, 2017
@ghost
Copy link

ghost commented Apr 9, 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 9, 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