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

output resource swallows lookup() errors. #10573

Closed
rkr-kununu opened this issue Dec 7, 2016 · 2 comments
Closed

output resource swallows lookup() errors. #10573

rkr-kununu opened this issue Dec 7, 2016 · 2 comments

Comments

@rkr-kununu
Copy link

It appears that output {} is not properly relaying errors, if a key within a map does not exist.

Terraform Version

version 0.7.13

Affected Resource(s)

  • output

Terraform Configuration Files

variable "mymap" {
  type = "map"
  default = {
    a = "apple"
    b = "banana"
  }
}

output "exists" {
  value = "${var.mymap["a"]}"
}

output "failure" {
  value = "${var.mymap["non-existant"]}"
}

output "failure2" {
  value = "${lookup( var.mymap, "non-existant" )}"
}

Expected Behavior

Error configuring: 1 error(s) occurred:

* key "non-existant" does not exist in map var.mymap in:
....

Actual Behavior

The output for "failure" and "failure2" was not reported nor was displayed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

exists = apple

Steps to Reproduce

  1. terraform apply
@mitchellh
Copy link
Contributor

Dup #9080

@ghost
Copy link

ghost commented Apr 19, 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 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants