Skip to content

Commit

Permalink
Implement policy edge resource
Browse files Browse the repository at this point in the history
Signed-off-by: Kobi Samoray <[email protected]>
  • Loading branch information
ksamoray committed Feb 25, 2025
1 parent d0b49b5 commit ae6c9b8
Show file tree
Hide file tree
Showing 4 changed files with 1,861 additions and 0 deletions.
24 changes: 24 additions & 0 deletions nsxt/policy_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,3 +739,27 @@ func getPolicyLbMonitorPortSchema() *schema.Schema {
func getVpcParentsFromContext(context utl.SessionContext) []string {
return []string{utl.DefaultOrgID, context.ProjectID, context.VPCID}
}

func getPolicyKeyValuePairListFromSchema(kvIList interface{}) []model.KeyValuePair {
var kvList []model.KeyValuePair
if kvIList != nil {
for _, kv := range kvIList.([]interface{}) {
kvMap := kv.(map[string]interface{})
key := kvMap["key"].(string)
val := kvMap["value"].(string)
kvList = append(kvList, model.KeyValuePair{Key: &key, Value: &val})
}
}
return kvList
}

func setPolicyKeyValueListForSchema(kvList []model.KeyValuePair) interface{} {
var kvIList []interface{}
for _, ec := range kvList {
kvMap := make(map[string]interface{})
kvMap["key"] = ec.Key
kvMap["value"] = ec.Value
kvIList = append(kvIList, kvMap)
}
return kvIList
}
1 change: 1 addition & 0 deletions nsxt/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ func Provider() *schema.Provider {
"nsxt_policy_project_ip_address_allocation": resourceNsxtPolicyProjectIpAddressAllocation(),
"nsxt_vpc_dhcp_v4_static_binding": resourceNsxtVpcSubnetDhcpV4StaticBindingConfig(),
"nsxt_policy_l7_access_profile": resourceNsxtPolicyL7AccessProfile(),
"nsxt_policy_edge_transport_node": resourceNsxtPolicyEdgeTransportNode(),
},

ConfigureFunc: providerConfigure,
Expand Down
Loading

0 comments on commit ae6c9b8

Please sign in to comment.