Skip to content

Commit

Permalink
add identities
Browse files Browse the repository at this point in the history
  • Loading branch information
rahalan committed Feb 26, 2022
1 parent e3f6171 commit 026f3d9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
14 changes: 14 additions & 0 deletions arm/Microsoft.EventGrid/systemTopics/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,25 @@ param roleAssignments array = []
@description('Optional. Specify the type of lock.')
param lock string = 'NotSpecified'

@description('Optional. Enables system assigned managed identity on the resource.')
param systemAssignedIdentity bool = false

@description('Optional. The ID(s) to assign to the resource.')
param userAssignedIdentities object = {}

@description('Optional. Tags of the resource.')
param tags object = {}

@description('Optional. Customer Usage Attribution ID (GUID). This GUID must be previously registered')
param cuaId string = ''

var identityType = systemAssignedIdentity ? (!empty(userAssignedIdentities) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned') : (!empty(userAssignedIdentities) ? 'UserAssigned' : 'None')

var identity = identityType != 'None' ? {
type: identityType
userAssignedIdentities: !empty(userAssignedIdentities) ? userAssignedIdentities : null
} : null

@description('Optional. The name of logs that will be streamed.')
@allowed([
'DeliveryFailures'
Expand Down Expand Up @@ -90,6 +103,7 @@ module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
resource eventGrid 'Microsoft.EventGrid/systemTopics@2021-12-01' = {
name: name
location: location
identity: identity
tags: tags
properties: {
source: source
Expand Down
17 changes: 16 additions & 1 deletion arm/Microsoft.EventGrid/systemTopics/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ This module deploys an event grid topic.
| `diagnosticWorkspaceId` | string | | | Optional. Resource ID of the diagnostic log analytics workspace. |
| `location` | string | `[resourceGroup().location]` | | Optional. Location for all Resources. |
| `lock` | string | `NotSpecified` | `[CanNotDelete, NotSpecified, ReadOnly]` | Optional. Specify the type of lock. |
| `logsToEnable` | array | `[DeliveryFailures, PublishFailures]` | `[DeliveryFailures, PublishFailures]` | Optional. The name of logs that will be streamed. |
| `logsToEnable` | array | `[DeliveryFailures]` | `[DeliveryFailures]` | Optional. The name of logs that will be streamed. |
| `metricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | Optional. The name of metrics that will be streamed. |
| `name` | string | | | Required. The name of the Event Grid Topic |
| `privateEndpoints` | array | `[]` | | Optional. Configuration Details for private endpoints. |
| `roleAssignments` | array | `[]` | | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11' |
| `source` | string | | | Required. Source for the system topic. |
| `systemAssignedIdentity` | bool | | | Optional. Enables system assigned managed identity on the resource. |
| `tags` | object | `{object}` | | Optional. Tags of the resource. |
| `topicType` | string | | | Required. TopicType for the system topic. |
| `userAssignedIdentities` | object | `{object}` | | Optional. The ID(s) to assign to the resource. |

### Parameter Usage: `privateEndpoints`

Expand Down Expand Up @@ -109,6 +111,19 @@ Tag names and tag values can be provided as needed. A tag can be left without a
}
```

### Parameter Usage: `userAssignedIdentities`

You can specify multiple user assigned identities to a resource by providing additional resource IDs using the following format:

```json
"userAssignedIdentities": {
"value": {
"/subscriptions/12345678-1234-1234-1234-123456789012/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-sxx-az-msi-x-001": {},
"/subscriptions/12345678-1234-1234-1234-123456789012/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-sxx-az-msi-x-002": {}
}
},
```

## Outputs

| Output Name | Type | Description |
Expand Down

0 comments on commit 026f3d9

Please sign in to comment.