Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
network resources redesigned
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Santonastaso committed Jun 25, 2019
1 parent e6ec849 commit 785018e
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions okta/resource_network_zone.go
Expand Up @@ -8,18 +8,6 @@ import (
"github.com/hashicorp/terraform/helper/validation"
)

var addressObjectSchema = map[string]*schema.Schema{
"type": &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.StringInSlice([]string{"CIDR", "RANGE"}, false),
Required: true,
},
"value": &schema.Schema{
Type: schema.TypeString,
Required: true,
},
}

func resourceNetworkZone() *schema.Resource {
return &schema.Resource{
Create: resourceNetworkZoneCreate,
Expand All @@ -32,27 +20,23 @@ func resourceNetworkZone() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"gateways": &schema.Schema{
"gateway_type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "IP addresses (range or CIDR form) of this zone",
ValidateFunc: validation.StringInSlice([]string{"CIDR", "RANGE"}, false),
},
"gateway_values": {
Type: schema.TypeList,
Optional: true,
Description: "IP addresses (range or CIDR form) of this zone",
Elem: &schema.Resource{
Schema: addressObjectSchema,
},
Description: "Array of values in CIDR/range form depending on the type specified",
Elem: &schema.Schema{Type: schema.TypeString},
},
"name": &schema.Schema{
Type: schema.TypeString,
Required: true,
Description: "Name of the Network Zone Resource",
},
"proxies": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "IP addresses (range or CIDR form) allowed to forward request from",
Elem: &schema.Resource{
Schema: addressObjectSchema,
},
},
"type": &schema.Schema{
Type: schema.TypeString,
Required: true,
Expand Down

0 comments on commit 785018e

Please sign in to comment.