/// <summary> /// Constructs an object used to create a virtual nerwork. /// </summary> /// <param name="vnetCidr"> The CIDR of the resource. </param> /// <param name="location"> The location of the resource. </param> /// <returns> A builder with <see cref="VirtualNetwork"/> and <see cref="VirtualNetworkData"/>. </returns> public ArmBuilder <VirtualNetwork, VirtualNetworkData> Construct(string vnetCidr, LocationData location = null) { var vnet = new Azure.ResourceManager.Network.Models.VirtualNetwork() { Location = location ?? DefaultLocation, AddressSpace = new AddressSpace() { AddressPrefixes = new List <string>() { vnetCidr } }, }; return(new ArmBuilder <VirtualNetwork, VirtualNetworkData>(this, new VirtualNetworkData(vnet))); }
/// <summary> /// Constructs an object used to create a virtual nerwork. /// </summary> /// <param name="vnetCidr"> The CIDR of the resource. </param> /// <param name="location"> The location of the resource. </param> /// <returns> A builder with <see cref="VirtualNetwork"/> and <see cref="VirtualNetworkData"/>. </returns> public ArmBuilder <VirtualNetwork, VirtualNetworkData> Construct(string vnetCidr, LocationData location = null) { var parent = GetParentResource <ResourceGroup, ResourceGroupOperations>(); var vnet = new Azure.ResourceManager.Network.Models.VirtualNetwork() { Location = location ?? parent.Data.Location, AddressSpace = new AddressSpace() { AddressPrefixes = new List <string>() { vnetCidr } }, }; return(new ArmBuilder <VirtualNetwork, VirtualNetworkData>(this, new VirtualNetworkData(vnet))); }