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 not exposing attribute for key #3

Closed
hashibot opened this issue Jun 13, 2017 · 3 comments
Closed

consul_keys not exposing attribute for key #3

hashibot opened this issue Jun 13, 2017 · 3 comments
Labels

Comments

@hashibot
Copy link

This issue was originally opened by @jniesen as hashicorp/terraform#7438. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

~ terraform -v
Terraform v0.7.0-rc2 (46a0709bba004d8b6e0eedad411270b3ae135a9e)

Affected Resource(s)

  • consul_keys

Terraform Configuration Files

provider "consul" {
  address    = "${var.consul_addr}"
  datacenter = "${var.consul_dc}"
  scheme     = "${var.consul_scheme}"
}

resource "consul_keys" "ro" {
  key {
    name = "ami"
    path = "${var.ami_path}/${var.ami_version}"
  }
}

resource "aws_launch_configuration" "a" {
  name_prefix   = "artifactory-"
  instance_type = "t2.large"
  image_id      = "${consul_keys.ro.var.ami}"
  key_name      = "${var.ssh_key_name}"
  security_groups = [
    "${aws_security_group.a.id}"
  ]

  lifecycle {
    create_before_destroy = true
  }
}

Debug Output

https://gist.github.com/jniesen/7997ba2f475a0d8637a1a58f16cbe2da

Expected Behavior

Successful plan.

Actual Behavior

~ terraform plan .
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but
will not be persisted to local or remote state storage.

data.terraform_remote_state.manheim2_vpc: Refreshing state...

Error running plan: 1 error(s) occurred:

* Resource 'consul_keys.ro' does not have attribute 'var.ami' for variable 'consul_keys.ro.var.ami'

Steps to Reproduce

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

  1. terraform plan
@hashibot hashibot added the bug label Jun 13, 2017
@Chhed13
Copy link

Chhed13 commented Dec 24, 2017

Usage of key.name and consequently var block has been marked as deprecated in version 0.7. Maybe it's time to remove it and bug will gone with it?

@Chhed13
Copy link

Chhed13 commented Feb 2, 2018

I double checked it. And it works fine in Terraform 0.10.8 and breaks in 0.11.0. It caused by the same issue hashicorp/terraform#17048

@remilapeyre
Copy link
Collaborator

Hi @jniesen I tried and it looks like this issue happens with an old version of Terraform and not with Terraform 0.12.

Since Terraform 0.11 is not maintained anymore I will close this issue, if you still have problems with Terraform 0.12 please open it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants