-
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
Issue creating security group (Handle Sets) #87
Comments
Thanks! Keep them coming. :) |
I'm still seeing this behavior on master, both before and after a |
Just wanted to give you an update here. Although we were able to fix a bit of a bug related to this issue, there's still and underlying problem with how Terraform handles sets of objects, i.e in your example:
We store this as an array of ingress rules. To us, that ends up looking more or less like this:
Amazon IP permissions don't have a unique identifier, so we have to rely on the order while diffing. However, if Amazon changes their order remotely for some reason, Terraform thinks that things have changed. This is too naive and we need a better way to handle this. I'm assuming that's the issue you're now running in to, but either way what I just went over is still a related problem. I'm going to add to the issue name to reflect this. Let me know if that's not accurate! |
May I suggest producing a canonical order by sorting by [protocol, from_port, to_port, cidr_blocks (string-sorted) || security_groups (string-sorted)], and then just essentially doing a tree-diff to determine what changes need to be made to bring things in line with reality? |
I'm seeing this too, essentially setting a security group for port 80 and 443 (you can guess why :) Group gets created successfully, however when I do a plan it wants to do an update... ~ aws_security_group.loadbalancer Doing a sort before a comparison would be a great idea if the order cannot be guaranteed from the aws api call. On a slightly different note, I also get this error when I do an apply... ... That probably requires a different bug report, let me know if thats the case and I'll file one. |
+1 for producing a canonical representation of the rules. That'd at least solve the "nothing has changed but terraform thinks it has" problem. |
Fixed. We've added a Hurray! |
I'm still seeing this effect using Terraform 0.6.3. Is your suggested fix not released yet, @mitchellh? Or is there anything I need to do to get this fixed? Thanks! |
@tisba can you share a configuration that reproduces this? The fix in question was released in August of last year, and should be in place. If you have something that reproduces this (minus any secrets), I can dig in. Thanks! |
@catsby I'll try to cut out a minimal configuration that will trigger this issue and ping you when I'm done. |
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. |
After I created this security group
I see this output from
terraform plan
:And
terraform apply
fails with this message:The text was updated successfully, but these errors were encountered: