|
8 | 8 |
|
9 | 9 | "github.com/hashicorp/terraform/helper/hashcode" |
10 | 10 | "github.com/hashicorp/terraform/helper/schema" |
| 11 | + "github.com/hashicorp/terraform/helper/validation" |
11 | 12 | ) |
12 | 13 |
|
13 | 14 | func route() *schema.Resource { |
@@ -83,6 +84,20 @@ func resourceZeroTierNetwork() *schema.Resource { |
83 | 84 | Optional: true, |
84 | 85 | Default: true, |
85 | 86 | }, |
| 87 | + //Warning: Undecoumented on the API, but that is how the UI manages it |
| 88 | + "broadcast": &schema.Schema{ |
| 89 | + Type: schema.TypeBool, |
| 90 | + Description: "Enable network broadcast (ff:ff:ff:ff:ff:ff)", |
| 91 | + Optional: true, |
| 92 | + Default: true, |
| 93 | + }, |
| 94 | + "multicast_limit": &schema.Schema{ |
| 95 | + Type: schema.TypeInt, |
| 96 | + Description: "The maximum number of recipients that can receive an Ethernet multicast or broadcast. Setting to 0 disables multicast, but be aware that only IPv6 with NDP emulation (RFC4193 or 6PLANE addressing modes) or other unicast-only protocols will work without multicast.", |
| 97 | + Optional: true, |
| 98 | + Default: 32, |
| 99 | + ValidateFunc: validation.IntAtLeast(0), |
| 100 | + }, |
86 | 101 | "route": &schema.Schema{ |
87 | 102 | Type: schema.TypeSet, |
88 | 103 | Optional: true, |
@@ -163,8 +178,10 @@ func fromResourceData(d *schema.ResourceData) (*Network, error) { |
163 | 178 | RulesSource: d.Get("rules_source").(string), |
164 | 179 | Description: d.Get("description").(string), |
165 | 180 | Config: &Config{ |
166 | | - Name: d.Get("name").(string), |
167 | | - Private: d.Get("private").(bool), |
| 181 | + Name: d.Get("name").(string), |
| 182 | + Private: d.Get("private").(bool), |
| 183 | + EnableBroadcast: d.Get("broadcast").(bool), |
| 184 | + MulticastLimit: d.Get("multicast_limit").(int), |
168 | 185 | V4AssignMode: V4AssignModeConfig{ |
169 | 186 | ZT: d.Get("auto_assign_v4").(bool), |
170 | 187 | }, |
@@ -214,6 +231,8 @@ func resourceNetworkRead(d *schema.ResourceData, m interface{}) error { |
214 | 231 | d.Set("name", net.Config.Name) |
215 | 232 | d.Set("description", net.Description) |
216 | 233 | d.Set("private", net.Config.Private) |
| 234 | + d.Set("broadcast", net.Config.EnableBroadcast) |
| 235 | + d.Set("multicast_limit", net.Config.MulticastLimit) |
217 | 236 | d.Set("auto_assign_v4", net.Config.V4AssignMode.ZT) |
218 | 237 | d.Set("auto_assign_v6", net.Config.V6AssignMode.ZT) |
219 | 238 | d.Set("auto_assign_6plane", net.Config.V6AssignMode.SixPLANE) |
|
0 commit comments