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

Invalid resource attributes in outputs ignored #9080

Closed
sethvargo opened this issue Sep 27, 2016 · 5 comments
Closed

Invalid resource attributes in outputs ignored #9080

sethvargo opened this issue Sep 27, 2016 · 5 comments

Comments

@sethvargo
Copy link
Contributor

Terraform Version

Terraform v0.7.5-dev (e12f42a)

Affected Resource(s)

  • core

Terraform Configuration Files

variable "aws_access_key" {}
variable "aws_secret_key" {}
variable "aws_region" {}

provider "aws" {
  access_key = "${var.aws_access_key}"
  secret_key = "${var.aws_secret_key}"
  region     = "${var.aws_region}"
}

resource "aws_vpc" "repro" {
  cidr_block = "10.1.0.0/16"
}

output "vpc" {
  value = "${aws_vpc.repro.not-a-real-attribute}"
}

Debug Output

Debug output

Expected Behavior

Terraform should error that "not-a-real-attribute" is not a real attribute.

Actual Behavior

Terraform ignores the attribute; it is missing from the output at the end.

Steps to Reproduce

  1. terraform apply or terraform refresh

Important Factoids

Running master, but reproed on 0.7.4 too.

@jbardin
Copy link
Member

jbardin commented Sep 27, 2016

Probably related to #8077

@mitchellh
Copy link
Contributor

There is definitely another bug tracking this, this has been a longstanding issue for probably years. The issue has to do with apply vs plan time validation and interpolation. This is likely fixable with new graphs but I'm unsure...

@keymon
Copy link
Contributor

keymon commented May 23, 2017

I confirm this is still happening in Terraform 0.9.5. It also happens for any interpolation error:

Here is a simpler test case (no relying on AWS):

resource "null_resource" "some_resource" {
  triggers {
    foo = "1"
  }
}

output "an_ouput" {
  value = "1"
}

output "invalid_interpolation" {
  value = "${upper(map())}"
}

output "invalid attribute_in_resource" {
  value = "${null_resource.some_resource.non_existent}"
}

The 2 latest outputs should fail.

@jbardin
Copy link
Member

jbardin commented Oct 27, 2017

This is fixed by #16204, and now enabled in master

@ghost
Copy link

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

4 participants