-
Notifications
You must be signed in to change notification settings - Fork 37
FIX: Tofu attempts to apply security groups when port_security_enabled is false #601
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
Conversation
So the actual error without this PR, when settting
even screwier the logic appears to be evaluated properly:
|
Can we omit the security groups if port_security is false? |
For me, it used to work when using admin creds. When I switched to non-admin creds, I actually just enabled port security on the network (even though I don't think it is implemented). |
cef3ced
to
aa12167
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, I think this makes sense. In some places we can skip adding security groups on some networks.
I like keeping port security on, unless we find a good use case to turn that off.
Do we put docs for this extra flag somewhere? |
Yeah this is not ready to merge. It needs documenting in the variables.tf file (in both places it applies) |
Tested as working on leafcloud with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previous fix for #598 doesn't work.
lookup(each.value, "port_security_enabled", null) != false ? var.security_group_ids : []
still applies the security groups even when port_security_enabled is false.
EDIT:
Solution is to circumvent toggling port security entirely with https://registry.terraform.io/providers/vtdc/viettelidcops/latest/docs/resources/networking_port_v2#no_security_groups-1
Then disabling security groups is done by: