-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add support for linking service and address groups to network security rules #345
Add support for linking service and address groups to network security rules #345
Conversation
Hi @jan-walther , |
Done :) |
/ok-to-test |
Hi @jan-walther |
Hi @siddharth-nutanix, |
Hi guys,
$ git diff
diff --git a/nutanix/resource_nutanix_network_security_rule.go b/nutanix/resource_nutanix_network_security_rule.go
index e990310d..26743471 100644
--- a/nutanix/resource_nutanix_network_security_rule.go
+++ b/nutanix/resource_nutanix_network_security_rule.go
@@ -1153,6 +1153,7 @@ func expandNetworkRule(prefix string, d *schema.ResourceData) *v3.NetworkSecurit
if ippl, ipok := nr["ip_subnet_prefix_length"]; ipok && ippl.(string) != "" {
if i, err := strconv.Atoi(ippl.(string)); err == nil {
iPSubnet.PrefixLength = utils.Int64Ptr(int64(i))
+ nrItem.IPSubnet = iPSubnet
}
}
@@ -1220,8 +1221,6 @@ func expandNetworkRule(prefix string, d *schema.ResourceData) *v3.NetworkSecurit
if icmp, icmpok := nr["icmp_type_code_list"]; icmpok {
nrItem.IcmpTypeCodeList = expandIcmpTypeCodeList(icmp)
}
-
- nrItem.IPSubnet = iPSubnet
if !reflect.DeepEqual(*filter, v3.CategoryFilter{}) {
nrItem.Filter = filter
}
@@ -1560,11 +1559,11 @@ func referenceListSchema() *schema.Schema {
Schema: map[string]*schema.Schema{
"kind": {
Type: schema.TypeString,
- Computed: true,
+ Required: true,
},
"uuid": {
Type: schema.TypeString,
- Computed: true,
+ Required: true,
},
"name": {
Type: schema.TypeString, |
/ok-to-test
|
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"uuid": { |
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.
Shouldn't UUID be marked as optional & computed as it will be an input to API.
@jan-walther thoughts?
Can you also attach a working example in the PR?
Expansion of #322 to support linking the newly created resourced with a network security rule