diff --git a/builtin/providers/openstack/resource_openstack_networking_router_v2.go b/builtin/providers/openstack/resource_openstack_networking_router_v2.go index 3e78cc1ae0b5..c9aae8c68d0a 100644 --- a/builtin/providers/openstack/resource_openstack_networking_router_v2.go +++ b/builtin/providers/openstack/resource_openstack_networking_router_v2.go @@ -48,11 +48,10 @@ func resourceNetworkingRouterV2() *schema.Resource { ForceNew: true, Computed: true, }, - "router_type": &schema.Schema{ - Type: schema.TypeString, + "driver_opts": &schema.Schema{ + Type: schema.TypeMap, Optional: true, ForceNew: true, - Computed: true, }, }, } @@ -68,7 +67,7 @@ func resourceNetworkingRouterV2Create(d *schema.ResourceData, meta interface{}) createOpts := routers.CreateOpts{ Name: d.Get("name").(string), TenantID: d.Get("tenant_id").(string), - RouterType: d.Get("router_type").(string), + DriverOpts: routerDriverOpts(d), } if asuRaw, ok := d.GetOk("admin_state_up"); ok { @@ -134,7 +133,6 @@ func resourceNetworkingRouterV2Read(d *schema.ResourceData, meta interface{}) er d.Set("name", n.Name) d.Set("admin_state_up", n.AdminStateUp) d.Set("tenant_id", n.TenantID) - d.Set("router_type", n.RouterType) d.Set("external_gateway", n.GatewayInfo.NetworkID) return nil @@ -235,3 +233,11 @@ func waitForRouterDelete(networkingClient *gophercloud.ServiceClient, routerId s return r, "ACTIVE", nil } } + +func routerDriverOpts(d *schema.ResourceData) map[string]string { + m := make(map[string]string) + for key, val := range d.Get("driver_opts").(map[string]interface{}) { + m[key] = val.(string) + } + return m +} diff --git a/website/source/docs/providers/openstack/r/networking_router_v2.html.markdown b/website/source/docs/providers/openstack/r/networking_router_v2.html.markdown index 18d77446c230..7ba09522045c 100644 --- a/website/source/docs/providers/openstack/r/networking_router_v2.html.markdown +++ b/website/source/docs/providers/openstack/r/networking_router_v2.html.markdown @@ -44,7 +44,7 @@ The following arguments are supported: * `tenant_id` - (Optional) The owner of the floating IP. Required if admin wants to create a router for another tenant. Changing this creates a new router. -* `router_type` - (Optional) Either exclusive or shared. +* `driver_opts` - (Optional) Map of additional driver-specific options. ## Attributes Reference @@ -55,4 +55,4 @@ The following attributes are exported: * `admin_state_up` - See Argument Reference above. * `external_gateway` - See Argument Reference above. * `tenant_id` - See Argument Reference above. -* `router_type` - See Argument Reference above. +* `driver_opts` - See Argument Reference above.