virtual_networks#
State module for managing Virtual Network.
- async idem_azure.states.azure.network.virtual_networks.present(hub, ctx, name: str, resource_group_name: str, virtual_network_name: str, address_space: List[str], location: str, resource_id: str = None, extended_location: ExtendedLocation = None, bgp_communities: VirtualNetworkBgpCommunities = None, flow_timeout_in_minutes: int = None, subnets: List[SubnetSet] = None, ddos_protection_plan: Id = None, enable_ddos_protection: bool = None, enable_vm_protection: bool = None, dhcp_options: DhcpOptions = None, subscription_id: str = None, tags: Dict = None) Dict [source]#
Create or update Virtual Networks.
- Parameters:
name (str) – The identifier for this state.
resource_group_name (str) – The name of the resource group.
virtual_network_name (str) – The name of the virtual network.
address_space (list) – An array of IP address ranges that can be used by subnets of the virtual network.
location (str) – Resource location. This field can not be updated.
resource_id (str, Optional) – Virtual Network resource id on Azure.
extended_location (Dict, Optional) –
The extended location of the virtual network.
- name(str):
The name of the extended location.
- type(str):
The type of the extended location. Enum type. Allowed values: EdgeZone
bgp_communities (Dict, Optional) –
Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET.
- virtual_network_community(str):
The BGP community associated with the virtual network.
flow_timeout_in_minutes (int, Optional) – The FlowTimeout value (in minutes) for the Virtual Network
subnets (list, Optional) –
List of Subnet in a virtual network resource.Each Subnet will have fields
- name(str, Optional):
The name of subnet.
- address_prefix(str, Optional):
The address prefix for the subnet.
- address_prefixes(list, Optional):
List of address prefixes for the subnet.
- security_group_id(str, Optional):
The security group id.
- service_endpoints(list, Optional):
List of service endpoint.
dhcp_options (Dict, Optional) –
DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options.
- dns_servers(List, Optional):
The list of DNS servers IP addresses.
ddos_protection_plan (Dict, Optional) –
- id(str):
The DDoS protection plan associated with the virtual network.
enable_ddos_protection (bool, Optional) – Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource.
enable_vm_protection (bool, Optional) – Indicates if VM protection is enabled for all the subnets in the virtual network.
subscription_id (str, Optional) – Subscription Unique id.
tags (dict, Optional) – Resource tags.
- Returns:
dict
Examples
my-vnet: azure.network.virtual_networks.present: - name: my-vnet - resource_group_name: my-rg-1 - virtual_network_name: my-vnet-1 - location: westus - flow_timeout_in_minutes: 15 - tags: my-tag-key: my-tag-value - subnets: - name: subnet_name address_prefix: 10.0.0.0/26 security_group_id: /subscriptions/subscription_id/resourceGroups/resource_group_name/providers/Microsoft.Network/networkSecurityGroups/network-security-group-name service_endpoints: - Microsoft.Storage - address_space: - 10.0.0.0/26
- async idem_azure.states.azure.network.virtual_networks.absent(hub, ctx, name: str, resource_id: str = None, resource_group_name: str = None, virtual_network_name: str = None, subscription_id: str = None) Dict [source]#
Delete Virtual Networks.
- Parameters:
name (str) – The identifier for this state.
resource_id (str, Optional) – Virtual Network resource id on Azure.
resource_group_name (str, Optional) – The name of the resource group.
virtual_network_name (str, Optional) – The name of the virtual network.
subscription_id (str, Optional) – Subscription Unique id.
- Returns:
dict
Examples
resource_is_absent: azure.network.virtual_networks.absent: - name: value - resource_group_name: value - virtual_network_name: value
- async idem_azure.states.azure.network.virtual_networks.describe(hub, ctx) Dict[str, Dict[str, Any]] [source]#
Describe the resource in a way that can be recreated/managed with the corresponding “present” function.
Lists all Virtual Networks under the same subscription
- Returns:
Dict[str, Any]
Examples
$ idem describe azure.network.virtual_networks