provider/azurerm: Add tags to `azurerm_virtual_network`

This commit is contained in:
James Nugent 2016-01-18 12:45:08 -05:00
parent a32980e8a7
commit d5e3db9deb
1 changed files with 6 additions and 0 deletions

View File

@ -75,6 +75,8 @@ func resourceArmVirtualNetwork() *schema.Resource {
Required: true, Required: true,
ForceNew: true, ForceNew: true,
}, },
"tags": tagsSchema(),
}, },
} }
} }
@ -88,11 +90,13 @@ func resourceArmVirtualNetworkCreate(d *schema.ResourceData, meta interface{}) e
name := d.Get("name").(string) name := d.Get("name").(string)
location := d.Get("location").(string) location := d.Get("location").(string)
resGroup := d.Get("resource_group_name").(string) resGroup := d.Get("resource_group_name").(string)
tags := d.Get("tags").(map[string]interface{})
vnet := network.VirtualNetwork{ vnet := network.VirtualNetwork{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: getVirtualNetworkProperties(d), Properties: getVirtualNetworkProperties(d),
Tags: expandTags(tags),
} }
resp, err := vnetClient.CreateOrUpdate(resGroup, name, vnet) resp, err := vnetClient.CreateOrUpdate(resGroup, name, vnet)
@ -162,6 +166,8 @@ func resourceArmVirtualNetworkRead(d *schema.ResourceData, meta interface{}) err
} }
d.Set("dns_servers", dnses) d.Set("dns_servers", dnses)
flattenAndSetTags(d, resp.Tags)
return nil return nil
} }