-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathevent-hub-namespace.bicep
73 lines (67 loc) · 2.57 KB
/
event-hub-namespace.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { roleAssignmentInfo } from '../security/managed-identity.bicep'
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@export()
@description('SKU information for Event Hub Namespace.')
type skuInfo = {
@description('Name of the SKU.')
name: 'Basic' | 'Premium' | 'Standard'
}
@description('Event Hub Namespace SKU. Defaults to Basic.')
param sku skuInfo = {
name: 'Basic'
}
@description('Whether to enable public network access. Defaults to Enabled.')
@allowed([
'Enabled'
'Disabled'
'SecuredByPerimeter'
])
param publicNetworkAccess string = 'Enabled'
@description('Whether to enable auto-inflate. Defaults to False.')
param isAutoInflateEnabled bool = false
@description('The maximum throughput units for the namespace. Defaults to 0.')
param maximumThroughputUnits int = 0
@description('Value indicating whether the namespace is zone-redundant. Defaults to false.')
param zoneRedundant bool = false
@description('Whether to disable local (key-based) authentication. Defaults to true.')
param disableLocalAuth bool = true
@description('Role assignments to create for the Document Intelligence instance.')
param roleAssignments roleAssignmentInfo[] = []
resource eventHubNamespace 'Microsoft.EventHub/namespaces@2024-05-01-preview' = {
name: name
location: location
tags: tags
sku: {
name: sku.name
tier: sku.name
}
properties: {
isAutoInflateEnabled: isAutoInflateEnabled
maximumThroughputUnits: maximumThroughputUnits
publicNetworkAccess: publicNetworkAccess
zoneRedundant: zoneRedundant
disableLocalAuth: disableLocalAuth
}
}
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
for roleAssignment in roleAssignments: {
name: guid(eventHubNamespace.id, roleAssignment.principalId, roleAssignment.roleDefinitionId)
scope: eventHubNamespace
properties: {
principalId: roleAssignment.principalId
roleDefinitionId: roleAssignment.roleDefinitionId
principalType: roleAssignment.principalType
}
}
]
@description('The deployed Event Hub Namespace resource.')
output resource resource = eventHubNamespace
@description('ID for the deployed Event Hub Namespace resource.')
output id string = eventHubNamespace.id
@description('Name for the deployed Event Hub Namespace resource.')
output name string = eventHubNamespace.name