-
Notifications
You must be signed in to change notification settings - Fork 1
/
ehub.bicep
97 lines (83 loc) · 2.18 KB
/
ehub.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//
// Deploys an Azure Event Hub namespace
// with associated Event Hub
// with associated sending key
// https://learn.microsoft.com/en-us/azure/event-hubs/
//
@description('Descriptor for the parent namespace resource')
@minLength(3)
param prefix string = 'ehubns'
@description('Descriptor for the hub resource')
param hubname string = 'ehub'
@description('Name of sending key')
param sendkeyname string = 'SendKey'
@description('Name of listening key')
param listenkeyname string = 'ListenKey'
@description('Unique suffix for all resources in this deployment')
@minLength(3)
param suffix string = uniqueString(resourceGroup().id)
@description('Location for all resources.')
param location string = resourceGroup().location
@description('SKU name.')
param sku string = 'Basic'
@description('Number of provisioned units.')
param capacity int = 1
resource namespace 'Microsoft.EventHub/namespaces@2022-10-01-preview' = {
name: '${prefix}-${suffix}'
location: location
sku: {
name: sku
tier: sku
capacity: capacity
}
properties: {
minimumTlsVersion: '1.2'
publicNetworkAccess: 'Enabled'
disableLocalAuth: false
zoneRedundant: true
isAutoInflateEnabled: false
maximumThroughputUnits: 0
kafkaEnabled: false
}
}
resource sendkey 'Microsoft.EventHub/namespaces/authorizationrules@2022-10-01-preview' = {
parent: namespace
name: sendkeyname
properties: {
rights: [
'Send'
]
}
}
resource listenkey 'Microsoft.EventHub/namespaces/authorizationrules@2022-10-01-preview' = {
parent: namespace
name: sendkeyname
properties: {
rights: [
'Listen'
]
}
}
resource ehub 'Microsoft.EventHub/namespaces/eventhubs@2022-10-01-preview' = {
parent: namespace
name: hubname
properties: {
retentionDescription: {
cleanupPolicy: 'Delete'
retentionTimeInHours: 1
}
messageRetentionInDays: 1
partitionCount: 2
status: 'Active'
}
}
output result object = {
namespace: namespace.name
key: sendkey.name
hub: ehub.name
}
output namespace string = namespace.name
output id string = namespace.id
output sendkey string = sendkey.name
output hub string = ehub.name
output listenkey string = listenkeyname