-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Fix a nil access error when security group can't be found. #2797
Conversation
Hey @thegedge thanks for submitting this – I'm curious, do you have a configuration that reproduces this, so I can verify? A crash log would be helpful too, if you have it. The code change looks fine, I'm just trying to understand what happened. Thanks! |
It seems like something that needs to be fixed in this method https://github.com/hashicorp/terraform/blob/b-aws-route53record-errors/builtin/providers/aws/resource_aws_security_group_rule.go#L252 |
Unfortunately I lost the You're right that this may need to be fixed in I'll try to put together a scenario (state + config + world) that triggers this issue. |
Thanks @thegedge ! |
Okay, really easy to trigger. Whip up a simple config:
Then follow these steps:
[EDIT] |
@catsby let me know if you'd like an alternative fix, or if you're happy with this approach. If the latter, I can update create/delete so that they don't panic for similar reasons. Another thought I had was that, in my example, should |
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. |
Not sure of the specifics on how I hit this codepath, but this fixed a panic I was seeing where
sg
was nil.