Skip to content

Commit

Permalink
Merge pull request #5877 from brent-au/feature/add-vwan-type-to-vwan-…
Browse files Browse the repository at this point in the history
…resource

azurerm_virtual_wan  - support for the `type` property
  • Loading branch information
katbyte authored Feb 26, 2020
2 parents 88ffd0e + 2c8bcd0 commit 900f89c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions azurerm/internal/services/network/resource_arm_virtual_wan.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ func resourceArmVirtualWan() *schema.Resource {
Default: string(network.OfficeTrafficCategoryNone),
},

"type": {
Type: schema.TypeString,
Optional: true,
Default: "Standard",
},

"tags": tags.Schema(),
},
}
Expand All @@ -96,6 +102,7 @@ func resourceArmVirtualWanCreateUpdate(d *schema.ResourceData, meta interface{})
allowBranchToBranchTraffic := d.Get("allow_branch_to_branch_traffic").(bool)
allowVnetToVnetTraffic := d.Get("allow_vnet_to_vnet_traffic").(bool)
office365LocalBreakoutCategory := d.Get("office365_local_breakout_category").(string)
virtualWanType := d.Get("type").(string)
t := d.Get("tags").(map[string]interface{})

if features.ShouldResourcesBeImported() && d.IsNewResource() {
Expand All @@ -119,6 +126,7 @@ func resourceArmVirtualWanCreateUpdate(d *schema.ResourceData, meta interface{})
AllowBranchToBranchTraffic: utils.Bool(allowBranchToBranchTraffic),
AllowVnetToVnetTraffic: utils.Bool(allowVnetToVnetTraffic),
Office365LocalBreakoutCategory: network.OfficeTrafficCategory(office365LocalBreakoutCategory),
Type: utils.String(virtualWanType),
},
}

Expand Down Expand Up @@ -177,6 +185,7 @@ func resourceArmVirtualWanRead(d *schema.ResourceData, meta interface{}) error {
d.Set("allow_branch_to_branch_traffic", props.AllowBranchToBranchTraffic)
d.Set("allow_vnet_to_vnet_traffic", props.AllowVnetToVnetTraffic)
d.Set("office365_local_breakout_category", props.Office365LocalBreakoutCategory)
d.Set("type", props.Type)
}

return tags.FlattenAndSet(d, resp.Tags)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ resource "azurerm_virtual_wan" "test" {
allow_branch_to_branch_traffic = true
allow_vnet_to_vnet_traffic = true
office365_local_breakout_category = "All"
type = "Standard"
tags = {
Hello = "There"
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/virtual_wan.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ The following arguments are supported:

* `office365_local_breakout_category` - (Optional) Specifies the Office365 local breakout category. Possible values include: `Optimize`, `OptimizeAndAllow`, `All`, `None`. Defaults to `None`.

* `type` - (Optional) Specifies the Virtual WAN type. Possible Values include: `Basic` and `Standard`. Defaults to `Standard`.

* `tags` - (Optional) A mapping of tags to assign to the Virtual WAN.

## Attributes Reference
Expand Down

0 comments on commit 900f89c

Please sign in to comment.