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

Malformed aws_security_group_rule causes crash, not syntax error - tf 0.6.4 #3577

Closed
packplusplus opened this issue Oct 20, 2015 · 6 comments

Comments

@packplusplus
Copy link

If you use some malformed syntax in a security_group rule, you don't get syntax error, you get a crash.

provider "aws" {
}

resource "aws_security_group" "sg_test" {
  name = "sg_test"
}

resource "aws_security_group_rule" "sg_test_rule" {
  type = "ingress"
  from_port = 22
  to_port = 22
  protocol = "tcp"
  security_group_id = [ "${aws_security_group.sg_test.id}" ]
}

You can use this example to get the crash log, but the main error appears to be:

panic: Error reading level config: '' expected type 'string', got unconvertible type '[]interface {}'
terraform --version
Terraform v0.6.4
@catsby
Copy link
Contributor

catsby commented Oct 21, 2015

Thanks @packplusplus – this is related to validating computed values, in your example security_group_id is both malformed and computed. If you were to manually hardcode security_group_id you'd get the regular syntax error.

Fortunately, I just confirmed that this issue is fixed in #3009, so we'll close this when that gets merged.

Thanks for opening the issue!

@packplusplus
Copy link
Author

+1 thanks @catsby

@apparentlymart
Copy link
Contributor

Fixed by 8fdffb6

@catsby
Copy link
Contributor

catsby commented Oct 26, 2015

Thanks for the follow up, @apparentlymart

@packplusplus
Copy link
Author

Verified fixed in 0.6.6. You're both great! Crashes scare me.

@ghost
Copy link

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

3 participants