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,
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
}