-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Crash when list is assigned to string parameter #2984
Comments
@choosy it looks like you got this error with a |
Hi @apparentlymart, I have put it here: Thank you for your investigation. |
I think the problem here is that you've put a list as the value of It is a bug in Terraform that this wasn't caught during the configuration validation step and instead blew up inside the diffing logic. However, you should be able to work around that bug by using a separate resource "aws_route_table_association" "rt-assoc-dmz-use1b" {
route_table_id = "${aws_route_table.rt-vpc18-dmz.id}"
subnet_id = "${aws_subnet.vpc18-dmz-us-east-1b.id}"
}
resource "aws_route_table_association" "rt-assoc-dmz-use1c" {
route_table_id = "${aws_route_table.rt-vpc18-dmz.id}"
subnet_id = "${aws_subnet.vpc18-dmz-us-east-1c.id}"
}
resource "aws_route_table_association" "rt-assoc-dmz-use1d" {
route_table_id = "${aws_route_table.rt-vpc18-dmz.id}"
subnet_id = "${aws_subnet.vpc18-dmz-us-east-1d.id}"
}
resource "aws_route_table_association" "rt-assoc-dmz-use1e" {
route_table_id = "${aws_route_table.rt-vpc18-dmz.id}"
subnet_id = "${aws_subnet.vpc18-dmz-us-east-1e.id}"
} |
Hi @apparentlymart , That was it. I managed to get passed that using your example. Thank you! |
Great! I'm glad that worked out. @choosy would you mind changing the title of your issue to "Crash when list is assigned to string parameter"? That should make it easier for folks to find this issue and increase the chance that it'll be fixed. |
I can repro your crash with your exact config but interestingly if I try to simplify it to just the core issue of using a list instead of a string then it ceases to be a crash and instead appears as a regular error:
Here is my simplified config: resource "aws_route_table_association" "foo" {
route_table_id = "bar"
subnet_id = ["baz", "foo"]
} Either way this is not a user-friendly error message since it uses Go type system terminology rather than Terraform config language terminology. Feels to me like there's a missing check earlier up the chain that should've caught this in both cases, and it just happens that in one case it gets |
I made a nicer validation error message in #3009, but that hasn't fixed this crash. It seems that somehow the |
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. |
Got this crash report.
https://gist.github.com/choosy/a41dde20526671837943
The text was updated successfully, but these errors were encountered: