network_security_groups#
State module for managing Network security group.
- async idem_azure.states.azure.network.network_security_groups.present(hub, ctx, name: str, resource_group_name: str, network_security_group_name: str, location: str, security_rules: List[SecurityRule] = None, tags: Dict = None, subscription_id: str = None, resource_id: str = None) Dict [source]#
Create or update Network Security Groups.
- Parameters:
name (str) – The identifier for this state.
resource_group_name (str) – The name of the resource group.
network_security_group_name (str) – The name of the network security group.
location (str) – The location to create the resource in.
security_rules (list[dict[str, Any]], Optional) –
List of security rules. Each security rule contains:
- name(str):
The name of the security rule.
- priority(int):
The priority of the security rule. The value can be between 100 and 4096.The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
- direction(str):
The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
- access(str):
The network traffic is allowed or denied.
- protocol(str):
Network protocol this rule applies to.
- source_port_range(str, Optional):
The source port or range. Integer or range between 0 and 65535. Asterisk ‘*’ can also be used to match all ports.
- destination_port_range(str, Optional):
The destination port or range. Integer or range between 0 and 65535. Asterisk ‘*’ can also be used to match all ports.
- source_address_prefix(str, Optional):
The source address prefix. CIDR or source IP range. Asterisk ‘*’ can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress rule, specifies where network traffic originates from.
- destination_address_prefix(str, Optional):
The destination address prefix. CIDR or destination IP range. Asterisk ‘*’ can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used.
- source_port_ranges(list[str], Optional):
The source port ranges. Either this or source_port_range need to be provided.
- destination_port_ranges(list[str], Optional):
The destination port ranges.Either this or destination_port_range need to be provided.
- source_address_prefixes(list[str], Optional):
The CIDR or source IP ranges. Either source_address_prefix or source_address_prefixes needs to be provided.
- destination_address_prefixes(list[str], Optional):
The destination address prefixes. CIDR or destination IP ranges. Either destination_address_prefix or destination_address_prefixes needs to be provided.
tags (Dict, Optional) – Resource tags.
subscription_id (str, Optional) – Subscription Unique id.
resource_id (str, Optional) – Resource Group id on Azure.
- Returns:
Dict
Examples
resource_is_present: azure.network.network_security_groups.present: - name: value - resource_group_name: value - network_security_group_name: value - location: value - tags: value
- async idem_azure.states.azure.network.network_security_groups.absent(hub, ctx, name: str, resource_id: str = None, resource_group_name: str = None, network_security_group_name: str = None, subscription_id: str = None) Dict [source]#
Delete Network Security Groups.
- Parameters:
name (str) – The identifier for this state.
resource_id (str, Optional) – Resource Group id on Azure.
resource_group_name (str, Optional) – The name of the resource group.
network_security_group_name (str, Optional) – The name of the network security group.
subscription_id (str, Optional) – Unique subscription ID
- Returns:
Dict
Examples
resource_is_absent: azure.network.network_security_groups.absent: - name: value - resource_group_name: value - network_security_group_name: value
- async idem_azure.states.azure.network.network_security_groups.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 Network Security Groups under the same subscription.
- Returns:
Dict[str, Any]
Examples
$ idem describe azure.network.network_security_groups