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

Commit

Permalink
gateways and proxies implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Santonastaso committed Jun 25, 2019
1 parent 566212d commit e6ec849
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions okta/resource_network_zone.go
Expand Up @@ -2,10 +2,24 @@ package okta

import (
"fmt"
"log"

"github.com/hashicorp/terraform/helper/schema"
"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 @@ -18,11 +32,27 @@ func resourceNetworkZone() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"gateways": &schema.Schema{
Type: schema.TypeList,
Optional: true,
Description: "IP addresses (range or CIDR form) of this zone",
Elem: &schema.Resource{
Schema: addressObjectSchema,
},
},
"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 All @@ -34,6 +64,7 @@ func resourceNetworkZone() *schema.Resource {
}

func resourceNetworkZoneCreate(d *schema.ResourceData, m interface{}) error {
log.Printf("[INFO] Create Network Zone %v", d.Get("name").(string))
return fmt.Errorf("[ERROR] Okta Network Zone not implemented")
}

Expand Down

0 comments on commit e6ec849

Please sign in to comment.