subnets#

State module for managing Subnets.

async idem_azure.states.azure.network.subnets.present(hub, ctx, name: str, resource_group_name: str, virtual_network_name: str, subnet_name: str, address_prefix: str, enforce_private_link_endpoint_network_policies: bool = None, delegations: List[DelegationSet] = None, enforce_private_link_service_network_policies: bool = None, service_endpoints: List = None, service_endpoint_policy_ids: List = None, subscription_id: str = None, resource_id: str = None) Dict[source]#

Create or updates Subnets.

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.

  • subnet_name (str) – The name of the subnet.

  • address_prefix (str) – The address prefix for the subnet.

  • enforce_private_link_endpoint_network_policies (bool, Optional) – Enable or Disable apply network policies on private end point in the subnet.

  • delegations (list, Optional) –

    An array of references to the delegations on the subnet. Defaults to None

    • name(str, Optional):

      The name of the resource that is unique within a subnet.

    • service(str, Optional):

      The name of the service to whom the subnet should be delegated.

  • enforce_private_link_service_network_policies (bool, Optional) – Enable or Disable apply network policies on private link service in the subnet.

  • service_endpoints (list, Optional) – An array of service endpoints

  • service_endpoint_policy_ids (list, Optional) – An array of service endpoint policy Ids.

  • subscription_id (str, Optional) – Subscription Unique id.

  • resource_id (str, Optional) – Subnet resource id on Azure

Returns:

Dict

Examples

my-subnet:
  azure.network.subnets.present:
    - name: my-subnet
    - resource_group_name: my-resource-group
    - subscription_id: my-subscription
    - virtual_network_name: my-vnet
    - subnet_name: my-subnet-1
    - address_prefix: 10.0.0.0/24
    - enforce_private_link_endpoint_network_policies: True/False
    - delegations:
        - name: my-delegation-1
          service: Microsoft.StoragePool/diskPools
    - enforce_private_link_service_network_policies: True/False
    - service_endpoints:
        - Microsoft.Sql
        - Microsoft.Storage
    - service_endpoint_policy_ids:
        - /subscriptions/subscription_id/resourceGroups/resource_group_name/providers/Microsoft.Network/serviceEndpointPolicies/service_endpoint_policy_name
        - /subscriptions/subscription_id/resourceGroups/resource_group_name/providers/Microsoft.Network/serviceEndpointPolicies/service_endpoint_policy_name
async idem_azure.states.azure.network.subnets.absent(hub, ctx, name: str, resource_group_name: str, virtual_network_name: str, subnet_name: str, subscription_id: str = None) Dict[source]#

Delete Subnets.

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.

  • subnet_name (str) – The name of the subnet.

  • subscription_id (str, Optional) – Subscription Unique id.

Returns:

Dict

Examples

my-subnet:
  azure.network.subnets.absent:
    - name: my-subnet
    - resource_group_name: my-resource-group
    - virtual_network_name: my-vnet
    - subnet_name: my-subnet-1
    - subscription_id: my-subscription
async idem_azure.states.azure.network.subnets.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 Subnets under the same subscription.

Returns:

Dict[str, Any]

Examples

$ idem describe azure.network.subnets