Skip to content

Commit

Permalink
Update README/ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
krbar committed Sep 8, 2024
1 parent 03d1677 commit 50f0dbc
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 1 deletion.
64 changes: 64 additions & 0 deletions avm/res/insights/data-collection-rule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:<vers
name: 'idcrcusadv001'
// Non-required parameters
location: '<location>'
managedIdentities: {
systemAssigned: true
}
tags: {
'hidden-title': 'This is visible in the resource name'
kind: 'Windows'
Expand Down Expand Up @@ -308,6 +311,11 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:<vers
"location": {
"value": "<location>"
},
"managedIdentities": {
"value": {
"systemAssigned": true
}
},
"tags": {
"value": {
"hidden-title": "This is visible in the resource name",
Expand Down Expand Up @@ -398,6 +406,11 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:<vers
name: 'idcrcusbas001'
// Non-required parameters
location: '<location>'
managedIdentities: {
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
tags: {
'hidden-title': 'This is visible in the resource name'
kind: 'Windows'
Expand Down Expand Up @@ -488,6 +501,13 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:<vers
"location": {
"value": "<location>"
},
"managedIdentities": {
"value": {
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
},
"tags": {
"value": {
"hidden-title": "This is visible in the resource name",
Expand Down Expand Up @@ -1216,6 +1236,12 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:<vers
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
managedIdentities: {
systemAssigned: true
userAssignedResourceIds: [
'<managedIdentityResourceId>'
]
}
roleAssignments: [
{
name: '89a4d6fa-defb-4099-9196-173d94b91d67'
Expand Down Expand Up @@ -1331,6 +1357,14 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:<vers
"name": "myCustomLockName"
}
},
"managedIdentities": {
"value": {
"systemAssigned": true,
"userAssignedResourceIds": [
"<managedIdentityResourceId>"
]
}
},
"roleAssignments": {
"value": [
{
Expand Down Expand Up @@ -1926,6 +1960,7 @@ module dataCollectionRule 'br/public:avm/res/insights/data-collection-rule:<vers
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`location`](#parameter-location) | string | Location for all Resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`managedIdentities`](#parameter-managedidentities) | object | The managed identity definition for this resource. |
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`tags`](#parameter-tags) | object | Resource tags. |

Expand Down Expand Up @@ -1995,6 +2030,34 @@ Specify the name of lock.
- Required: No
- Type: string

### Parameter: `managedIdentities`

The managed identity definition for this resource.

- Required: No
- Type: object

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | bool | Enables system assigned managed identity on the resource. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |

### Parameter: `managedIdentities.systemAssigned`

Enables system assigned managed identity on the resource.

- Required: No
- Type: bool

### Parameter: `managedIdentities.userAssignedResourceIds`

The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.

- Required: No
- Type: array

### Parameter: `roleAssignments`

Array of role assignments to create.
Expand Down Expand Up @@ -2107,6 +2170,7 @@ Resource tags.
| `name` | string | The name of the dataCollectionRule. |
| `resourceGroupName` | string | The name of the resource group the dataCollectionRule was created in. |
| `resourceId` | string | The resource ID of the dataCollectionRule. |
| `systemAssignedMIPrincipalId` | string | The principal ID of the system assigned identity. |

## Data Collection

Expand Down
42 changes: 41 additions & 1 deletion avm/res/insights/data-collection-rule/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,36 @@
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "9024628264172390673"
"templateHash": "3740033198213213168"
},
"name": "Data Collection Rules",
"description": "This module deploys a Data Collection Rule.",
"owner": "Azure/module-maintainers"
},
"definitions": {
"managedIdentitiesType": {
"type": "object",
"properties": {
"systemAssigned": {
"type": "bool",
"nullable": true,
"metadata": {
"description": "Optional. Enables system assigned managed identity on the resource."
}
},
"userAssignedResourceIds": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true,
"metadata": {
"description": "Optional. The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption."
}
}
},
"nullable": true
},
"dataCollectionRulePropertiesType": {
"type": "object",
"discriminator": {
Expand Down Expand Up @@ -396,6 +419,12 @@
"description": "Optional. The lock settings of the service."
}
},
"managedIdentities": {
"$ref": "#/definitions/managedIdentitiesType",
"metadata": {
"description": "Optional. The managed identity definition for this resource."
}
},
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"metadata": {
Expand All @@ -411,6 +440,8 @@
}
},
"variables": {
"formattedUserAssignedIdentities": "[reduce(map(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createArray()), lambda('id', createObject(format('{0}', lambdaVariables('id')), createObject()))), createObject(), lambda('cur', 'next', union(lambdaVariables('cur'), lambdaVariables('next'))))]",
"identity": "[if(not(empty(parameters('managedIdentities'))), createObject('type', if(coalesce(tryGet(parameters('managedIdentities'), 'systemAssigned'), false()), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'SystemAssigned,UserAssigned', 'SystemAssigned'), if(not(empty(coalesce(tryGet(parameters('managedIdentities'), 'userAssignedResourceIds'), createObject()))), 'UserAssigned', 'None')), 'userAssignedIdentities', if(not(empty(variables('formattedUserAssignedIdentities'))), variables('formattedUserAssignedIdentities'), null())), null())]",
"builtInRoleNames": {
"Contributor": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"Owner": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')]",
Expand Down Expand Up @@ -449,6 +480,7 @@
"kind": "[parameters('dataCollectionRuleProperties').kind]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"identity": "[variables('identity')]",
"properties": "[variables('dataCollectionRulePropertiesUnion')]"
},
"dataCollectionRuleAll": {
Expand All @@ -458,6 +490,7 @@
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"identity": "[variables('identity')]",
"properties": "[variables('dataCollectionRulePropertiesUnion')]"
},
"dataCollectionRule_conditionalScopeResources": {
Expand Down Expand Up @@ -715,6 +748,13 @@
"description": "The location the resource was deployed into."
},
"value": "[if(equals(parameters('dataCollectionRuleProperties').kind, 'All'), reference('dataCollectionRuleAll', '2023-03-11', 'full').location, reference('dataCollectionRule', '2023-03-11', 'full').location)]"
},
"systemAssignedMIPrincipalId": {
"type": "string",
"metadata": {
"description": "The principal ID of the system assigned identity."
},
"value": "[if(equals(parameters('dataCollectionRuleProperties').kind, 'All'), coalesce(tryGet(tryGet(reference('dataCollectionRuleAll', '2023-03-11', 'full'), 'identity'), 'principalId'), ''), coalesce(tryGet(tryGet(reference('dataCollectionRule', '2023-03-11', 'full'), 'identity'), 'principalId'), ''))]"
}
}
}

0 comments on commit 50f0dbc

Please sign in to comment.