Terraform v0.7.5-dev (e12f42a8b5c91e7ae17eef5dcd0629491d74b59a)
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}"
}
Terraform should error that "not-a-real-attribute" is not a real attribute.
Terraform ignores the attribute; it is missing from the output at the end.
terraform apply or terraform refreshRunning master, but reproed on 0.7.4 too.
Probably related to #8077
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...
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.
This is fixed by #16204, and now enabled in master
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.
Most helpful comment
This is fixed by #16204, and now enabled in master