Share via


Microsoft.Network networkManagers/securityAdminConfigurations/ruleCollections 2022-07-01

Bicep resource definition

The networkManagers/securityAdminConfigurations/ruleCollections resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections@2022-07-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    appliesToGroups: [
      {
        networkGroupId: 'string'
      }
    ]
    description: 'string'
  }
}

Property Values

Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections

Name Description Value
name The resource name string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: networkManagers/securityAdminConfigurations
properties Indicates the properties for the network manager admin rule collection. AdminRuleCollectionPropertiesFormat

AdminRuleCollectionPropertiesFormat

Name Description Value
appliesToGroups Groups for configuration NetworkManagerSecurityGroupItem[] (required)
description A description of the admin rule collection. string

NetworkManagerSecurityGroupItem

Name Description Value
networkGroupId Network manager group Id. string (required)

Usage Examples

Bicep Samples

A basic example of deploying Network Manager Admin Rule Collection.

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource networkManager 'Microsoft.Network/networkManagers@2022-09-01' = {
  name: resourceName
  location: location
  properties: {
    description: ''
    networkManagerScopeAccesses: [
      'SecurityAdmin'
    ]
    networkManagerScopes: {
      managementGroups: []
      subscriptions: [
        subscription().id
      ]
    }
  }
}

resource networkGroup 'Microsoft.Network/networkManagers/networkGroups@2022-09-01' = {
  parent: networkManager
  name: resourceName
  properties: {}
}

resource securityAdminConfiguration 'Microsoft.Network/networkManagers/securityAdminConfigurations@2022-09-01' = {
  parent: networkManager
  name: resourceName
  properties: {
    applyOnNetworkIntentPolicyBasedServices: []
  }
}

resource ruleCollection 'Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections@2022-09-01' = {
  parent: securityAdminConfiguration
  name: resourceName
  properties: {
    appliesToGroups: [
      {
        networkGroupId: networkGroup.id
      }
    ]
  }
}

ARM template resource definition

The networkManagers/securityAdminConfigurations/ruleCollections resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections resource, add the following JSON to your template.

{
  "type": "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections",
  "apiVersion": "2022-07-01",
  "name": "string",
  "properties": {
    "appliesToGroups": [
      {
        "networkGroupId": "string"
      }
    ],
    "description": "string"
  }
}

Property Values

Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections

Name Description Value
apiVersion The api version '2022-07-01'
name The resource name string (required)
properties Indicates the properties for the network manager admin rule collection. AdminRuleCollectionPropertiesFormat
type The resource type 'Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections'

AdminRuleCollectionPropertiesFormat

Name Description Value
appliesToGroups Groups for configuration NetworkManagerSecurityGroupItem[] (required)
description A description of the admin rule collection. string

NetworkManagerSecurityGroupItem

Name Description Value
networkGroupId Network manager group Id. string (required)

Usage Examples

Terraform (AzAPI provider) resource definition

The networkManagers/securityAdminConfigurations/ruleCollections resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections@2022-07-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      appliesToGroups = [
        {
          networkGroupId = "string"
        }
      ]
      description = "string"
    }
  }
}

Property Values

Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections

Name Description Value
name The resource name string (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: networkManagers/securityAdminConfigurations
properties Indicates the properties for the network manager admin rule collection. AdminRuleCollectionPropertiesFormat
type The resource type "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections@2022-07-01"

AdminRuleCollectionPropertiesFormat

Name Description Value
appliesToGroups Groups for configuration NetworkManagerSecurityGroupItem[] (required)
description A description of the admin rule collection. string

NetworkManagerSecurityGroupItem

Name Description Value
networkGroupId Network manager group Id. string (required)

Usage Examples

Terraform Samples

A basic example of deploying Network Manager Admin Rule Collection.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
    azurerm = {
      source = "hashicorp/azurerm"
    }
  }
}

provider "azurerm" {
  features {
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

data "azurerm_client_config" "current" {
}

data "azapi_resource" "subscription" {
  type                   = "Microsoft.Resources/subscriptions@2021-01-01"
  resource_id            = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"
  response_export_values = ["*"]
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "networkManager" {
  type      = "Microsoft.Network/networkManagers@2022-09-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      description = ""
      networkManagerScopeAccesses = [
        "SecurityAdmin",
      ]
      networkManagerScopes = {
        managementGroups = [
        ]
        subscriptions = [
          data.azapi_resource.subscription.id,
        ]
      }
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "securityAdminConfiguration" {
  type      = "Microsoft.Network/networkManagers/securityAdminConfigurations@2022-09-01"
  parent_id = azapi_resource.networkManager.id
  name      = var.resource_name
  body = {
    properties = {
      applyOnNetworkIntentPolicyBasedServices = []
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "networkGroup" {
  type      = "Microsoft.Network/networkManagers/networkGroups@2022-09-01"
  parent_id = azapi_resource.networkManager.id
  name      = var.resource_name
  body = {
    properties = {
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "ruleCollection" {
  type      = "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections@2022-09-01"
  parent_id = azapi_resource.securityAdminConfiguration.id
  name      = var.resource_name
  body = {
    properties = {
      appliesToGroups = [
        {
          networkGroupId = azapi_resource.networkGroup.id
        },
      ]
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}