-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Interpolation error when referencing multiple sources #12892
Comments
Looks like #12765 is the culprit here |
also hit this in terraform 0.9.1 |
Also having this problem since upgrading to 0.9.1. I'm using a map of known IP addresses and passing those to security groups. I'm temporarily hardcoding the addresses to resources until this is fixed. |
I get the same reported behaviour as well within modules. Variable defaults are set for known places, whereas VPC vars are needed to be parsed into the module. ExampleFile Path: module "kitteh_litter_box" {
source = "./kitteh_server"
vpc_id = "${module.aws_vpc.vpc_id}"
vpc_cidr_block = "${module.aws_vpc.vpc_cidr_block}"
} File Path: variable "vpc_cidr_block" {
description = "The VPC CIDR block"
type = "string"
} File Path: variable "kitteh_cidr" {
type = "string"
default = "123.123.123.123/32"
}
resource "aws_security_group" "kitteh_server" {
vpc_id = "${var.vpc_id}"
name = "security_kitteh_server"
description = "Allows teh HTTPSing through"
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = [
"${var.kitteh_cidr}", // Fails due to being a default var
"${var.vpc_cidr_block}", // Fails due to being passed in
]
}
} You can comment either out and it will happily move on to planing. |
Got hit by the same issue, large scale =( |
Hmpf. I just noticed that going back to 0.9.0 isn't an option either, as that version doesn't support passing backend k/v on the command line. For me that pretty much means that 0.9 in general is unusable. |
reify the list values before validation
Fixed via: #13046 |
Thanks for the quick response! |
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. |
Interpolation seems to fail when referencing values from different types of sources.
In the example below, the ingress block contains:
When both interpolations are present, the Terraform plan fails. If either one is removed, the plan succeeds.
This bug was introduced in version 0.9.1.
Terraform Version
0.9.1
Affected Resource(s)
This example use
aws_security_group
to demonstrate this issue. However, it's very possible this is a core bug.Terraform Configuration Files
Debug Output
https://gist.github.com/srhaber/0c356008b1b782466a9e6e4368d5e312
Expected Behavior
Output from
terraform plan
using 0.9.0:Actual Behavior
Output from
terraform plan
using 0.9.1:Steps to Reproduce
terraform plan
on the example configThe text was updated successfully, but these errors were encountered: