From d5e3db9deb54bc75e7127f0d9e8dd7e8c2058422 Mon Sep 17 00:00:00 2001 From: James Nugent Date: Mon, 18 Jan 2016 12:45:08 -0500 Subject: [PATCH] provider/azurerm: Add tags to `azurerm_virtual_network` --- builtin/providers/azurerm/resource_arm_virtual_network.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builtin/providers/azurerm/resource_arm_virtual_network.go b/builtin/providers/azurerm/resource_arm_virtual_network.go index 3c748c8ba3..964a1baa75 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_network.go +++ b/builtin/providers/azurerm/resource_arm_virtual_network.go @@ -75,6 +75,8 @@ func resourceArmVirtualNetwork() *schema.Resource { Required: true, ForceNew: true, }, + + "tags": tagsSchema(), }, } } @@ -88,11 +90,13 @@ func resourceArmVirtualNetworkCreate(d *schema.ResourceData, meta interface{}) e name := d.Get("name").(string) location := d.Get("location").(string) resGroup := d.Get("resource_group_name").(string) + tags := d.Get("tags").(map[string]interface{}) vnet := network.VirtualNetwork{ Name: &name, Location: &location, Properties: getVirtualNetworkProperties(d), + Tags: expandTags(tags), } resp, err := vnetClient.CreateOrUpdate(resGroup, name, vnet) @@ -162,6 +166,8 @@ func resourceArmVirtualNetworkRead(d *schema.ResourceData, meta interface{}) err } d.Set("dns_servers", dnses) + flattenAndSetTags(d, resp.Tags) + return nil }