-
Notifications
You must be signed in to change notification settings - Fork 85
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
nsxt_policy_group conjection default to OR #800
Comments
Hi @jvboyle, sorry for delay in response. |
Hello, thank you for the issue. I am wondering how to solve it. In my case, I have var.list = [ "porttag1", "porttag2" ], which are tag of interface on a segment. I want to create resources nsxt_policy_group "myPort" with both ports: |
I want: criteria { |
I do not find another solution than with var.ports the list of port: :-( resource "nsxt_policy_group" "networkTag" { dynamic "conjunction" { dynamic "conjunction" { |
I'm not sure that what @llebotlan is asking is the same as what @jvboyle initially created the issue for. However, I do have a suggestion for the latest problem. Intuitively you might think that the resource definition must look like this: criteria - conjunction - criteria - conjunction - criteria ... The way the resource is defined though, the provider is totally fine with: criteria - criteria - criteria - conjunction - conjunction As long as the number of conjuctions is one less than the number of criteria. As such you can define a dynamic resource like this:
Obviously the conjunction can be changed to "AND" and you could also have a seperate array variable for the conjunction if required. Maybe that helps? |
For the ease of dynamic blocks, we can change the terraform side code to ignore the last conjunction, so that the number of conjunctions and conditions will be equal. Would that help @llebotlan @jvboyle? |
Hello, i do not think so, because it is a complexe(not logical) workaround. But a warning and the previous exemple in the manual, would be better (from my point of view) |
Is your feature request related to a problem? Please describe.
when setting dynamic criteria with for_each loops , the need to set conjunction is required for multi server sets , the default behavior of OR , limits the use of the group because it infers only 1 object in the list would added. if this is set to AND , you can built a list of objects and the function of the "grouping " would be as intended
Describe the solution you'd like
criteria {
condition {
key = "Name"
member_type = "VirtualMachine"
operator = "EQUALS"
value = "server1"
}
}
conjunction {
operator = "OR"
}
criteria {
condition {
key = "Name"
member_type = "VirtualMachine"
operator = "EQUALS"
value = "server2"
}
}
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: